git add <file>git rm <file>git mv <file>git add -pgit stashgit stash listgit stash show stash@{0}git stash applygit stash apply stash@{0}git stash --include-untrackedgit stash --allgit stash save 'WIP: making progress in foo'git stash branch <optional stash name>git checkout <stash name> -- <file name>git stash popgit stash dropgit stash drop stash@{n}git stash cleargit tag <tag-name>git tag -a <tag-name> -m 'your message for tag'git taggit show-ref --tagsgit tag --points-at <commit>git show <tag-name>git merge --no-ffgit config rerere.enabled trueuse --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> --statgit show <commit>:<file>git diffgit diff --stagedgit branch --merged mastergit branch --no-merged mastergit checkout -- <file_path>git checkout <commit> -- <file-path>git checkout <deleting-commit>^ -- <file_path>git cleangit clean --dry-rungit clean -d --dry-rungit clean -d -fgit reset --softgit reset --mixedgit reset --hardgit reset ORIG_HEADgit revert <commit>git commit --amendgit 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 --abortgit remote -vgit remote add upstream <repository_path>git checkout -t origin/featuregit push -u origin featuregit fetchgit pullgit pull = git fetch && git mergegit cherry -vgit push <tag_name>git push --tagsgit push -fgit reset --merge ORIG_HEADgit 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