Git cheat sheet

First Aid kit for Git

In case of reverting git push:

$ git reset <last functioning commit id> 
$ git stash
$ git push -f origin <branch name>
$ git stash pop

Changing your name and email globally:

git config --global user.name=“Phung, Danh-Nhan“
git config —global user.email=“danhnhan.phung@gmail.com"

Check your Git configs:

git config --list

Prepare release flow example:

git checkout release/2.3.0
git tag 2.3.0
git checkout master
git merge release/2.3.0
git push --tags origin master
git branch -d release/2.3.0

Last updated