git add <file>
git rm <file>
git mv <file>
git add -p
git stash
git stash list
git stash show stash@{0}
git stash apply
git stash apply stash@{0}
git stash --include-untracked
git stash --all
git stash save 'WIP: making progress in foo'
git stash branch <optional stash name>
git checkout <stash name> -- <file name>
git stash pop
git stash drop
git stash drop stash@{n}
git stash clear
git tag <tag-name>
git tag -a <tag-name> -m 'your message for tag'
git tag
git show-ref --tags
git tag --points-at <commit>
git show <tag-name>
git merge --no-ff
git config rerere.enabled true
use --global
flag to enable for all projects
git log --since='yesterday'
git log --since='2 weeks ago'
git log --name-status --follow -- <file>
git log --grep <regexp>
can be mixed with other git flags
git show <commit>
git show <commit> --stat
git show <commit>:<file>
git diff
git diff --staged
git branch --merged master
git branch --no-merged master
git checkout -- <file_path>
git checkout <commit> -- <file-path>
git checkout <deleting-commit>^ -- <file_path>
git clean
git clean --dry-run
git clean -d --dry-run
git clean -d -f
git reset --soft
git reset --mixed
git reset --hard
git reset ORIG_HEAD
git revert <commit>
git commit --amend
git rebase -i <commit_to_fix>^
- pick
- keep this commit
- reword
- keep the commit, just change the message
- edit
- keep the commit, but stop to edit more than the message
- squash
- combine this commit with the previous one. stop to edit the message
- fixup
- combine this commit with the previous one. keep the previous commit message
- exec
- run the command on this line after picking the previous commit
- drop
- remove the commit (tip: if you remove this line, the commit will be dropped too!)
git rebase --abort
git remote -v
git remote add upstream <repository_path>
git checkout -t origin/feature
git push -u origin feature
git fetch
git pull
git pull = git fetch && git merge
git cherry -v
git push <tag_name>
git push --tags
git push -f
git reset --merge ORIG_HEAD
git blame <filename>
git log —diff-filter=D -- <deleted_file>
git blame <commit>^ -- <deleted_file>
git blame -L1,5 -- <file>
git bisect start <BAD_SHA> <GOOD_SHA>
git config <setting> <value>
git config --global <setting> <value>
This pull request closes issue #number
You can add a .github/ folder for your project to specify templates for pull requests, issues, and contributing guidelines.
- contributing.md
- issue-template.md
- pull-request-template.md