git
Quick reference for git
commands.
Commands
- 📄 means the command is built-in.
- ✚ means the command is available from tj/git-extras.
- ⛓️ means the command is available from nvie/git-toolbelt.
Subcommand | Docs | Description |
---|---|---|
abort | ✚ | Abort a revert, rebase, merge or cherry-pick |
alias | ✚ | Define, search and show aliases |
archive-file | ✚ | Zip the repository |
authors | ✚ | Generate an AUTHORS file |
browse | ✚ | Open the repository in the browser |
browse-ci | ✚ | Open the CI pipeline in the browser |
brv | ✚ | Pretty-print branches with their last commit |
changelog | ✚ | Generate a HISTORY/CHANGE file content |
clear | ✚ | Clear unstage changes and remove untracked files (includes ignored files) |
clear-soft | ✚ | Clear unstage changes and remove untracked files (excludes ignored files) |
count | ✚ | Count the number of commits |
extras | ✚ | Show the man page of git-extras |
fork | ✚ | Fork and clone a repository |
ignore | ✚ | Show ignored patterns |
ignore-io | ✚ | Generate .gitignore from gitignore.io |
lock | ✚ | Lock a file from being changed in the repository |
locked | ✚ | List all locked files |
obliterate | ✚ | Remove a file from the entire history of a git repository |
root | ⛓️ | Show the root directory of the repository |
summary | ✚ | Show commit summary |
show-tree | ✚ | Show commit tree |
standup | ✚ | Show a user's contributions in the past n days |
unlock | ✚ | Unlock a file from being changed in the repository |
Snippets
Stage case-sensitive file changes
git mv --force old_name NEW_NAME
Remove commits after a certain commit
git rebase --committer-date-is-author-date -i <commit-hash>^