Commands
Cheatsheets for git subcommands
Topics
Pages
- clean
- clone
-
commit
About the git commit command
- config
-
describe
Get latest tag
- diff
- diff-index
- fetch
- filter-name
- gc
- git-grep
- init
- log
-
prune
Prune all unreachable objects from the object database
-
pull
The
git pull
command - push
- rebase
- restore
- revert
- rm
- shortlog
- stash
- status
- switch
- tag
- whatchanged
Content
See Git CLI docs.
Help
The log
subcommand is used for the examples below.
Summary
$ git log -h
Detailed
$ git log --help
Or
$ man git-log
Reset, restore and revert
There are three commands with similar names: git reset, git restore and git revert.
git-revert[1] is about making a new commit that reverts the changes made by other commits.
git-restore[1] is about restoring files in the working tree from either the index or another commit. This command does not update your branch. The command can also be used to restore files in the index from another commit.
git-reset[1] is about updating your branch, moving the tip in order to add or remove commits from the branch. This operation changes the commit history.