Git - CIA cheatsheet

Posted on Sat 11 March 2017 in git

Shamelessly taken from - https://wikileaks.org/ciav7p1/cms/page_1179773.html

  • List Aliases

    $ git config --get-regexp 'alias.*' | colrm 1 6 

  • Use last commit message for amend

    $ git commit --amend -C HEAD 

  • Undo last commit and bring everything to staging area

    $ git reset --soft HEAD^ 

  • Undo last commit and restart everything

    $ git reset --hard HEAD^ 

  • Create new branch with Stash changes

    $ git stash branch new-branch-name 

  • Git status in short format

    $ git status -s 

git