Git commands

Are you moving away from Git extensions and want to achieve more through Git bash? Here is a nice git command cheat sheet for you.

Change directory cd /c/folder1/folder2
Show directory ls
Git status git status
Reset one file git checkout -- folder1/folder2/SmallStrategy.cs
Push to branche1 on server git push origin branche1
Stage all modified files git add .
Stage all modified and new files git add -A
Commit git commit -m "Updated project file for Windows 10 RTM"
Show local branches git branch
Show remote branches git remote show origin
Create local branch git checkout -b loek/windows-10-fix
Force delete local branch git branch -D loek/windows-10-fix
Reset to origin/master git reset --hard origin/master
Rebase on master git rebase origin/master
Apply commit fb115 to current branch git cherry-pick fb115
Remove file(s) from git git rm --cached Mahjong/_scale*
Undo the last 13 commits and stage them git reset --soft HEAD~13
Undo Unstaged changes git checkout -- .
Unstage all git reset
Check remote address git remote show origin
Undo last commit ‘git reset HEAD~’