Cheatsheet for git
cd existing_repo
git remote rename origin old-origin
git remote add origin https://gitlab.com/some-project.git
git push -u origin --all
cd existing_folder
git init
git remote add origin https://gitlab.com/some-project.git
git add .
git commit -m "Initial commit"
git push -u origin master
git clone https://gitlab.com/some-project.git
cd some-project
nano README.md
git add README.md
git commit -m "add README"
git push -u origin master
git config --global user.name "Some Name"
git config --global user.email "something@somecompany.com"
git remote -v
git remote add origin https://gitlab.com/some-project.git
git remote push -u orgin master
git remote add some-short-name https://gitlab.com/some-other-project.git
git remote rm origin
git push origin +HEAD^:<remote-branch-name>
git branch blah
git checkout blah
git push -u origin blah
git reset --hard <commit-number>
git reflog
#To see complete commits
git log
git branch -m new-name
git push origin :old-name new-name
git branch -d branch-name
git push origin --delete branch-name
git add file-name
git commit --amend
git add file-name
git commit --squash old-commit-id
git rebase --autosquash -i old-commit-id
#Add file's name to .gitignore
git update-index --assume-unchanged <file_name>
#Remove file from .gitignore
git update-index --no-assume-unchanged <file_name>
git add <file_name>
git cherry-pick <commit-hash>