git-tips
Collection of
git-tips, want to add your tips? Checkout contributing.md
English | 中文 | Русский | 한국어 | Tiếng Việt | 日本語 | नेपाली | Polski | فارسی
Tools:
- git-tip - A handy CLI to make optimum use of these tips. (Here in Docker container)
P.S: All these commands are tested on git version 2.7.4 (Apple Git-66).
- Everyday Git in twenty commands or so
- Show helpful guides that come with Git
- Search change by content
- Show changes over time for specific file
- Remove sensitive data from history, after a push
- Sync with remote, overwrite local changes
- List of all files till a commit
- Git reset first commit
- Reset: preserve uncommitted local changes
- List all the conflicted files
- List of all files changed in a commit
- Unstaged changes since last commit
- Changes staged for commit
- Show both staged and unstaged changes
- List all branches that are already merged into master
- Quickly switch to the previous branch
- Remove branches that have already been merged with master
- List all branches and their upstreams, as well as last commit on branch
- Track upstream branch
- Delete local branch
- Delete remote branch
- Create local tag
- Delete local tag
- Delete remote tag
- Undo local changes with the last content in head
- Revert: Undo a commit by creating a new commit
- Reset: Discard commits, advised for private branch
- Reword the previous commit message
- See commit history for just the current branch
- Amend author.
- Reset author, after author has been changed in the global config.
- Changing a remote's URL
- Get list of all remote references
- Get list of all local and remote branches
- Get only remote branches
- Stage parts of a changed file, instead of the entire file
- Get git bash completion
- What changed since two weeks?
- See all commits made since forking from master
- Pick commits across branches using cherry-pick
- Find out branches containing commit-hash
- Git Aliases
- Saving current state of tracked files without commiting
- Saving current state of unstaged changes to tracked files
- Saving current state including untracked files
- Saving current state with message
- Saving current state of all files (ignored, untracked, and tracked)
- Show list of all saved stashes
- Show the contents of any stash in patch form
- Apply any stash without deleting from the stashed list
- Apply last stashed state and delete it from stashed list