Skip to content
[G]

Git Reference

Command
$ git init
$ git clone <url>
$ git config
$ git help
Command
$ git add <file>
$ git add .
$ git add -p
$ git rm <file>
$ git mv <src> <dst>
Command
$ git commit -m "<msg>"
$ git commit -a -m "<msg>"
$ git commit --amend
$ git status
Command
$ git branch
$ git branch <name>
$ git branch -d <name>
$ git checkout <branch>
$ git checkout -b <name>
$ git merge <branch>
$ git rebase <branch>
$ git tag
$ git tag <name>
Command
$ git log
$ git log --oneline
$ git diff
$ git diff --staged
$ git show <ref>
$ git shortlog
$ git blame <file>
$ git describe
Command
$ git remote add <name> <url>
$ git remote -v
$ git push
$ git push --tags
$ git pull
$ git fetch
Command
$ git reset HEAD <file>
$ git reset --soft HEAD~1
$ git reset --hard HEAD~1
$ git revert <commit>
$ git cherry-pick <commit>
$ git rebase -i HEAD~3
Command
$ git stash
$ git stash list
$ git stash pop
$ git stash drop
Command
$ git gc
$ git prune
$ git clean -fd
$ git archive
$ git bisect