git-tips

Collection of git-tips, want to add your tips? Checkout contributing.md

English | 中文 | Русский | 한국어 | Tiếng Việt | 日本語 | नेपाली | Polski | فارسی

Tools:

P.S: All these commands are tested on git version 2.7.4 (Apple Git-66).

Everyday Git in twenty commands or so

git help everyday

Show helpful guides that come with Git

git help -g

Search change by content

git log -S'<a term in the source>'

Show changes over time for specific file

git log -p <file_name>

Remove sensitive data from history, after a push

git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch <path-to-your-file>' --prune-empty --tag-name-filter cat -- --all && git push origin --force --all

Sync with remote, overwrite local changes

git fetch origin && git reset --hard origin/master && git clean -f -d

List of all files till a commit

git ls-tree --name-only -r <commit-ish>

Git reset first commit

git update-ref -d HEAD

Reset: preserve uncommitted local changes

git reset --keep <commit>

List all the conflicted files

git diff --name-only --diff-filter=U

List of all files changed in a commit

git diff-tree --no-commit-id --name-only -r <commit-ish>

Unstaged changes since last commit

git diff

Changes staged for commit

git diff --cached

Alternatives:

git diff --staged

Show both staged and unstaged changes

git diff HEAD

List all branches that are already merged into master

git branch --merged master

Quickly switch to the previous branch

git checkout -

Alternatives:

git checkout @{-1}

Remove branches that have already been merged with master

git branch --merged master | grep -v '^\*' | xargs -n 1 git branch -d

Alternatives:

git branch --merged master | grep -v '^\*\|  master' | xargs -n 1 git branch -d # will not delete master if master is not checked out

List all branches and their upstreams, as well as last commit on branch

git branch -vv

Track upstream branch

git branch -u origin/mybranch

Delete local branch

git branch -d <local_branchname>

Delete remote branch

git push origin --delete <remote_branchname>

Alternatives:

git push origin :<remote_branchname>
git branch -dr <remote/branch>

Create local tag

git tag <tag-name>

Delete local tag

git tag -d <tag-name>

Delete remote tag

git push origin :refs/tags/<tag-name>

Undo local changes with the content in index(staging)

git checkout -- <file_name>

Revert: Undo a commit by creating a new commit

git revert <commit-ish>

Reset: Discard commits, advised for private branch

git reset <commit-ish>

Reword the previous commit message

git commit -v --amend

See commit history for just the current branch

git cherry -v master

Amend author.

git commit --amend --author='Author Name <[email protected]>'

Reset author, after author has been changed in the global config.

git commit --amend --reset-author --no-edit

Changing a remote's URL

git remote set-url origin <URL>

Get list of all remote references

git remote

Alternatives:

git remote show

Get list of all local and remote branches

git branch -a

Get only remote branches

git branch -r

Stage parts of a changed file, instead of the entire file

git add -p

Get git bash completion

curl -L http://git.io/vfhol > ~/.git-completion.bash && echo '[ -f ~/.git-completion.bash ] && . ~/.git-completion.bash' >> ~/.bashrc

What changed since two weeks?

git log --no-merges --raw --since='2 weeks ago'

Alternatives:

git whatchanged --since='2 weeks ago'

See all commits made since forking from master

git log --no-merges --stat --reverse master..

Pick commits across branches using cherry-pick

git checkout <branch-name> && git cherry-pick <commit-ish>

Find out branches containing commit-hash

git branch -a --contains <commit-ish>

Alternatives:

git branch --contains <commit-ish>

Git Aliases

git config --global alias.<handle> <command> 
git config --global alias.st status

Saving current state of tracked files without commiting

git stash

Alternatives:

git stash push

Saving current state of unstaged changes to tracked files

git stash -k

Alternatives:

git stash --keep-index
git stash push --keep-index

Saving current state including untracked files

git stash -u

Alternatives:

git stash push -u
git stash push --include-untracked

Saving current state with message

git stash push -m <message>

Alternatives:

git stash push --message <message>

Saving current state of all files (ignored, untracked, and tracked)

git stash -a

Alternatives:

git stash --all
git stash push --all

Show list of all saved stashes

git stash list

Show the contents of any stash in patch form

git stash show -p <stash@{n}>

Apply any stash without deleting from the stashed list

git stash apply <stash@{n}>

Apply last stashed state and delete it from stashed list

git stash pop

Alternatives:

git stash apply stash@{0} && git stash drop stash@{0}

Delete all stored stashes

git stash clear

Alternatives:

git stash drop <stash@{n}>

Grab a single file from a stash

git checkout <stash@{n}> -- <file_path>

Alternatives:

git checkout stash@{0} -- <file_path>

Show all tracked files

git ls-files -t

Show all untracked files

git ls-files --others

Show all ignored files

git ls-files --others -i --exclude-standard

Create new working tree from a repository (git 2.5)

git worktree add -b <branch-name> <path> <start-point>

Create new working tree from HEAD state

git worktree add --detach <path> HEAD

Untrack files without deleting

git rm --cached <file_path>

Alternatives:

git rm --cached -r <directory_path>

Before deleting untracked files/directory, do a dry run to get the list of these files/directories

git clean -n

Forcefully remove untracked files

git clean -f

Forcefully remove untracked directory

git clean -f -d

Update all the submodules

git submodule foreach git pull

Alternatives:

git submodule update --init --recursive
git submodule update --remote

Show all commits in the current branch yet to be merged to master

git cherry -v master

Alternatives:

git cherry -v master <branch-to-be-merged>

Rename a branch

git branch -m <new-branch-name>

Alternatives:

git branch -m [<old-branch-name>] <new-branch-name>

Rebases 'feature' to 'master' and merges it in to master

git rebase master feature && git checkout master && git merge -

Archive the master branch

git archive master --format=zip --output=master.zip

Modify previous commit without modifying the commit message

git add --all && git commit --amend --no-edit

Prunes references to remove branches that have been deleted in the remote.

git fetch -p

Alternatives:

git remote prune origin

Delete local branches that has been squash and merged in the remote.

git branch -vv | grep ': gone]' | awk '{print <!-- @doxie.inject start -->}' | xargs git branch -D

Retrieve the commit hash of the initial revision.

 git rev-list --reverse HEAD | head -1

Alternatives:

git rev-list --max-parents=0 HEAD
git log --pretty=oneline | tail -1 | cut -c 1-40
git log --pretty=oneline --reverse | head -1 | cut -c 1-40

Visualize the version tree.

git log --pretty=oneline --graph --decorate --all

Alternatives:

gitk --all
git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d'

Visualize the tree including commits that are only referenced from reflogs

git log --graph --decorate --oneline $(git rev-list --walk-reflogs --all)

Deploying git tracked subfolder to gh-pages

git subtree push --prefix subfolder_name origin gh-pages

Adding a project to repo using subtree

git subtree add --prefix=<directory_name>/<project_name> --squash [email protected]:<username>/<project_name>.git master

Get latest changes in your repo for a linked project using subtree

git subtree pull --prefix=<directory_name>/<project_name> --squash [email protected]:<username>/<project_name>.git master

Export a branch with history to a file.

git bundle create <file> <branch-name>

Import from a bundle

git clone repo.bundle <repo-dir> -b <branch-name>

Get the name of current branch.

git rev-parse --abbrev-ref HEAD

Ignore one file on commit (e.g. Changelog).

git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog

Stash changes before rebasing

git rebase --autostash

Fetch pull request by ID to a local branch

git fetch origin pull/<id>/head:<branch-name>

Alternatives:

git pull origin pull/<id>/head:<branch-name>

Show the most recent tag on the current branch.

git describe --tags --abbrev=0

Show inline word diff.

git diff --word-diff

Show changes using common diff tools.

git difftool [-t <tool>] <commit1> <commit2> <path>

Don’t consider changes for tracked file.

git update-index --assume-unchanged <file_name>

Undo assume-unchanged.

git update-index --no-assume-unchanged <file_name>

Clean the files from .gitignore.

git clean -X -f

Restore deleted file.

git checkout <deleting_commit> -- <file_path>

Restore file to a specific commit-hash

git checkout <commit-ish> -- <file_path>

Always rebase instead of merge on pull.

git config --global pull.rebase true

Alternatives:

#git < 1.7.9
git config --global branch.autosetuprebase always

List all the alias and configs.

git config --list

Make git case sensitive.

git config --global core.ignorecase false

Add custom editors.

git config --global core.editor '$EDITOR'

Auto correct typos.

git config --global help.autocorrect 1

Check if the change was a part of a release.

git name-rev --name-only <SHA-1>

Dry run. (any command that supports dry-run flag should do.)

git clean -fd --dry-run

Marks your commit as a fix of a previous commit.

git commit --fixup <SHA-1>

Squash fixup commits normal commits.

git rebase -i --autosquash

Skip staging area during commit.

git commit --only <file_path>

Interactive staging.

git add -i

List ignored files.

git check-ignore *

Status of ignored files.

git status --ignored

Commits in Branch1 that are not in Branch2

git log Branch1 ^Branch2

List n last commits

git log -<n>

Alternatives:

git log -n <n>

Reuse recorded resolution, record and reuse previous conflicts resolutions.

git config --global rerere.enabled 1

Open all conflicted files in an editor.

git diff --name-only | uniq | xargs $EDITOR

Count unpacked number of objects and their disk consumption.

git count-objects --human-readable

Prune all unreachable objects from the object database.

git gc --prune=now --aggressive

Instantly browse your working repository in gitweb.

git instaweb [--local] [--httpd=<httpd>] [--port=<port>] [--browser=<browser>]

View the GPG signatures in the commit log

git log --show-signature

Remove entry in the global config.

git config --global --unset <entry-name>

Checkout a new branch without any history

git checkout --orphan <branch_name>

Extract file from another branch.

git show <branch_name>:<file_name>

List only the root and merge commits.

git log --first-parent

Change previous two commits with an interactive rebase.

git rebase --interactive HEAD~2

List all branch is WIP

git checkout master && git branch --no-merged

Find guilty with binary search

git bisect start                    # Search start 
git bisect bad                      # Set point to bad commit 
git bisect good v2.6.13-rc2         # Set point to good commit|tag 
git bisect bad                      # Say current state is bad 
git bisect good                     # Say current state is good 
git bisect reset                    # Finish search 

Bypass pre-commit and commit-msg githooks

git commit --no-verify

List commits and changes to a specific file (even through renaming)

git log --follow -p -- <file_path>

Clone a single branch

git clone -b <branch-name> --single-branch https://github.com/user/repo.git

Create and switch new branch

git checkout -b <branch-name>

Alternatives:

git branch <branch-name> && git checkout <branch-name>
git switch -c <branch-name>

Ignore file mode changes on commits

git config core.fileMode false

Turn off git colored terminal output

git config --global color.ui false

Specific color settings

git config --global <specific command e.g branch, diff> <true, false or always>

Show all local branches ordered by recent commits

git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/

Find lines matching the pattern (regex or string) in tracked files

git grep --heading --line-number 'foo bar'

Clone a shallow copy of a repository

git clone https://github.com/user/repo.git --depth 1

Search Commit log across all branches for given text

git log --all --grep='<given-text>'

Get first commit in a branch (from master)

git log --oneline master..<branch-name> | tail -1

Alternatives:

git log --reverse master..<branch-name> | head -6

Unstaging Staged file

git reset HEAD <file-name>

Force push to Remote Repository

git push -f <remote-name> <branch-name>

Adding Remote name

git remote add <remote-nickname> <remote-url>

List all currently configured remotes

git remote -v

Show the author, time and last revision made to each line of a given file

git blame <file-name>

Group commits by authors and title

git shortlog

Forced push but still ensure you don't overwrite other's work

git push --force-with-lease <remote-name> <branch-name>

Show how many lines does an author contribute

git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += <!-- @doxie.inject start -->; subs += <!-- @doxie.inject end -->; loc += <!-- @doxie.inject start --> - <!-- @doxie.inject end --> } END { printf "added lines: %s removed lines: %s total lines: %s
", add, subs, loc }' -

Alternatives:

git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += <!-- @doxie.inject start -->; subs += <!-- @doxie.inject end -->; loc += <!-- @doxie.inject start --> - <!-- @doxie.inject end --> } END { printf "added lines: %s, removed lines: %s, total lines: %s
", add, subs, loc }' - # on Mac OSX

Revert: Reverting an entire merge

git revert -m 1 <commit-ish>

Number of commits in a branch

git rev-list --count <branch-name>

Alias: git undo

git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'

Add object notes

git notes add -m 'Note on the previous commit....'

Show all the git-notes

git log --show-notes='*'

Apply commit from another repository

git --git-dir=<source-dir>/.git format-patch -k -1 --stdout <SHA1> | git am -3 -k

Specific fetch reference

git fetch origin master:refs/remotes/origin/mymaster

Find common ancestor of two branches

git merge-base <branch-name> <other-branch-name>

List unpushed git commits

git log --branches --not --remotes

Alternatives:

git log @{u}..
git cherry -v

Add everything, but whitespace changes

git diff --ignore-all-space | git apply --cached

Edit [local/global] git config

git config [--global] --edit

blame on certain range

git blame -L <start>,<end>

Show a Git logical variable.

git var -l | <variable>

Preformatted patch file.

git format-patch -M upstream..topic

Get the repo name.

git rev-parse --show-toplevel

logs between date range

git log --since='FEB 1 2017' --until='FEB 14 2017'

Exclude author from logs

git log --perl-regexp --author='^((?!excluded-author-regex).*)

Generates a summary of pending changes

git request-pull v1.0 https://git.ko.xz/project master:for-linus

List references in a remote repository

git ls-remote git://git.kernel.org/pub/scm/git/git.git

Backup untracked files.

git ls-files --others -i --exclude-standard | xargs zip untracked.zip

List all git aliases

git config -l | grep alias | sed 's/^alias\.//g'

Alternatives:

git config -l | grep alias | cut -d '.' -f 2

Show git status short

git status --short --branch

Checkout a commit prior to a day ago

git checkout master@{yesterday}

Push the current branch to the same name on the remote repository

git push origin HEAD

Push a new local branch to remote repository and track

git push -u origin <branch_name>

Change a branch base

git rebase --onto <new_base> <old_base>

Use SSH instead of HTTPs for remotes

git config --global url.'[email protected]:'.insteadOf 'https://github.com/'

Update a submodule to the latest commit

cd <path-to-submodule>
git pull origin <branch>
cd <root-of-your-main-project>
git add <path-to-submodule>
git commit -m "submodule updated"

Prevent auto replacing LF with CRLF

git config --global core.autocrlf false

git-tips/tips

{
"props": {
"initialPayload": {
"allShortcutsEnabled": false,
"path": "/",
"repo": {
"id": 39122628,
"defaultBranch": "master",
"name": "tips",
"ownerLogin": "git-tips",
"currentUserCanPush": false,
"isFork": false,
"isEmpty": false,
"createdAt": "2015-07-15T07:24:48.000Z",
"ownerAvatar": "https://avatars.githubusercontent.com/u/13345927?v=4",
"public": true,
"private": false,
"isOrgOwned": true
},
"currentUser": null,
"refInfo": {
"name": "master",
"listCacheKey": "v0:1588103318.0",
"canEdit": false,
"refType": "branch",
"currentOid": "1c23d34fbb90df79201432019c5b04dda58e76c8"
},
"tree": {
"items": [
{
"name": ".vscode",
"path": ".vscode",
"contentType": "directory"
},
{
"name": ".doxie.render.js",
"path": ".doxie.render.js",
"contentType": "file"
},
{
"name": ".doxie.render.toc.js",
"path": ".doxie.render.toc.js",
"contentType": "file"
},
{
"name": ".gitignore",
"path": ".gitignore",
"contentType": "file"
},
{
"name": "CODE_OF_CONDUCT.md",
"path": "CODE_OF_CONDUCT.md",
"contentType": "file"
},
{
"name": "LICENSE",
"path": "LICENSE",
"contentType": "file"
},
{
"name": "README.md",
"path": "README.md",
"contentType": "file"
},
{
"name": "contributing.md",
"path": "contributing.md",
"contentType": "file"
},
{
"name": "package-lock.json",
"path": "package-lock.json",
"contentType": "file"
},
{
"name": "package.json",
"path": "package.json",
"contentType": "file"
},
{
"name": "tips.json",
"path": "tips.json",
"contentType": "file"
}
],
"templateDirectorySuggestionUrl": null,
"readme": null,
"totalCount": 11,
"showBranchInfobar": false
},
"fileTree": null,
"fileTreeProcessingTime": null,
"foldersToFetch": [],
"treeExpanded": false,
"symbolsExpanded": false,
"isOverview": true,
"overview": {
"banners": {
"shouldRecommendReadme": false,
"isPersonalRepo": false,
"showUseActionBanner": false,
"actionSlug": null,
"actionId": null,
"showProtectBranchBanner": false,
"recentlyTouchedDataChannel": null,
"publishBannersInfo": {
"dismissActionNoticePath": "/settings/dismiss-notice/publish_action_from_repo",
"releasePath": "/git-tips/tips/releases/new?marketplace=true",
"showPublishActionBanner": false
},
"interactionLimitBanner": null,
"showInvitationBanner": false,
"inviterName": null
},
"codeButton": {
"contactPath": "/contact",
"isEnterprise": false,
"local": {
"protocolInfo": {
"httpAvailable": true,
"sshAvailable": null,
"httpUrl": "https://github.com/git-tips/tips.git",
"showCloneWarning": null,
"sshUrl": null,
"sshCertificatesRequired": null,
"sshCertificatesAvailable": null,
"ghCliUrl": "gh repo clone git-tips/tips",
"defaultProtocol": "http",
"newSshKeyUrl": "/settings/ssh/new",
"setProtocolPath": "/users/set_protocol"
},
"platformInfo": {
"cloneUrl": "https://desktop.github.com",
"showVisualStudioCloneButton": false,
"visualStudioCloneUrl": "https://windows.github.com",
"showXcodeCloneButton": false,
"xcodeCloneUrl": "https://developer.apple.com",
"zipballUrl": "/git-tips/tips/archive/refs/heads/master.zip"
}
},
"newCodespacePath": "/codespaces/new?hide_repo_select=true&repo=39122628"
},
"popovers": {
"rename": null,
"renamedParentRepo": null
},
"commitCount": "402",
"overviewFiles": [
{
"displayName": "README.md",
"repoName": "tips",
"refName": "master",
"path": "README.md",
"preferredFileType": "readme",
"tabName": "README",
"richText": "<article class=\"markdown-body entry-content container-lg\" itemprop=\"text\"><h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-git-tips\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#git-tips\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>git-tips</h2>\n<blockquote>\n<p dir=\"auto\">Collection of <code>git-tips</code>, want to add your tips? Checkout <a href=\"/git-tips/tips/blob/master/contributing.md\">contributing.md</a></p>\n</blockquote>\n<p dir=\"auto\"><a href=\"http://git.io/git-tips\" rel=\"nofollow\">English</a> | <a href=\"https://github.com/521xueweihan/git-tips\">中文</a> | <a href=\"https://github.com/Imangazaliev/git-tips\">Русский</a> | <a href=\"https://github.com/mingrammer/git-tips\">한국어</a> | <a href=\"https://github.com/hprobotic/git-tips\">Tiếng Việt</a> | <a href=\"https://github.com/isotai/git-tips\">日本語</a> | <a href=\"https://github.com/amarduwal/git-tips\">नेपाली</a> | <a href=\"https://github.com/mbiesiad/tips\">Polski</a> | <a href=\"https://github.com/javadnikbakht/git-tips\">فارسی</a></p>\n<h3 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-tools\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#tools\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a><strong>Tools:</strong></h3>\n<ul dir=\"auto\">\n<li><a href=\"https://www.npmjs.com/package/git-tip\" rel=\"nofollow\">git-tip</a> - A handy CLI to make optimum use of these tips. (<a href=\"https://github.com/djoudi5/docker-git-tip\">Here in Docker container</a>)</li>\n</ul>\n<p dir=\"auto\">P.S: All these commands are tested on <code>git version 2.7.4 (Apple Git-66)</code>.</p>\n\n\n<ul dir=\"auto\">\n<li><a href=\"#everyday-git-in-twenty-commands-or-so\">Everyday Git in twenty commands or so</a></li>\n<li><a href=\"#show-helpful-guides-that-come-with-git\">Show helpful guides that come with Git</a></li>\n<li><a href=\"#search-change-by-content\">Search change by content</a></li>\n<li><a href=\"#show-changes-over-time-for-specific-file\">Show changes over time for specific file</a></li>\n<li><a href=\"#remove-sensitive-data-from-history-after-a-push\">Remove sensitive data from history, after a push</a></li>\n<li><a href=\"#sync-with-remote-overwrite-local-changes\">Sync with remote, overwrite local changes</a></li>\n<li><a href=\"#list-of-all-files-till-a-commit\">List of all files till a commit</a></li>\n<li><a href=\"#git-reset-first-commit\">Git reset first commit</a></li>\n<li><a href=\"#reset-preserve-uncommitted-local-changes\">Reset: preserve uncommitted local changes</a></li>\n<li><a href=\"#list-all-the-conflicted-files\">List all the conflicted files</a></li>\n<li><a href=\"#list-of-all-files-changed-in-a-commit\">List of all files changed in a commit</a></li>\n<li><a href=\"#unstaged-changes-since-last-commit\">Unstaged changes since last commit</a></li>\n<li><a href=\"#changes-staged-for-commit\">Changes staged for commit</a></li>\n<li><a href=\"#show-both-staged-and-unstaged-changes\">Show both staged and unstaged changes</a></li>\n<li><a href=\"#list-all-branches-that-are-already-merged-into-master\">List all branches that are already merged into master</a></li>\n<li><a href=\"#quickly-switch-to-the-previous-branch\">Quickly switch to the previous branch</a></li>\n<li><a href=\"#remove-branches-that-have-already-been-merged-with-master\">Remove branches that have already been merged with master</a></li>\n<li><a href=\"#list-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch\">List all branches and their upstreams, as well as last commit on branch</a></li>\n<li><a href=\"#track-upstream-branch\">Track upstream branch</a></li>\n<li><a href=\"#delete-local-branch\">Delete local branch</a></li>\n<li><a href=\"#delete-remote-branch\">Delete remote branch</a></li>\n<li><a href=\"#create-local-tag\">Create local tag</a></li>\n<li><a href=\"#delete-local-tag\">Delete local tag</a></li>\n<li><a href=\"#delete-remote-tag\">Delete remote tag</a></li>\n<li><a href=\"#undo-local-changes-with-the-last-content-in-head\">Undo local changes with the last content in head</a></li>\n<li><a href=\"#revert-undo-a-commit-by-creating-a-new-commit\">Revert: Undo a commit by creating a new commit</a></li>\n<li><a href=\"#reset-discard-commits-advised-for-private-branch\">Reset: Discard commits, advised for private branch</a></li>\n<li><a href=\"#reword-the-previous-commit-message\">Reword the previous commit message</a></li>\n<li><a href=\"#see-commit-history-for-just-the-current-branch\">See commit history for just the current branch</a></li>\n<li><a href=\"#amend-author\">Amend author.</a></li>\n<li><a href=\"#reset-author-after-author-has-been-changed-in-the-global-config\">Reset author, after author has been changed in the global config.</a></li>\n<li><a href=\"#changing-a-remotes-url\">Changing a remote's URL</a></li>\n<li><a href=\"#get-list-of-all-remote-references\">Get list of all remote references</a></li>\n<li><a href=\"#get-list-of-all-local-and-remote-branches\">Get list of all local and remote branches</a></li>\n<li><a href=\"#get-only-remote-branches\">Get only remote branches</a></li>\n<li><a href=\"#stage-parts-of-a-changed-file-instead-of-the-entire-file\">Stage parts of a changed file, instead of the entire file</a></li>\n<li><a href=\"#get-git-bash-completion\">Get git bash completion</a></li>\n<li><a href=\"#what-changed-since-two-weeks\">What changed since two weeks?</a></li>\n<li><a href=\"#see-all-commits-made-since-forking-from-master\">See all commits made since forking from master</a></li>\n<li><a href=\"#pick-commits-across-branches-using-cherry-pick\">Pick commits across branches using cherry-pick</a></li>\n<li><a href=\"#find-out-branches-containing-commit-hash\">Find out branches containing commit-hash</a></li>\n<li><a href=\"#git-aliases\">Git Aliases</a></li>\n<li><a href=\"#saving-current-state-of-tracked-files-without-commiting\">Saving current state of tracked files without commiting</a></li>\n<li><a href=\"#saving-current-state-of-unstaged-changes-to-tracked-files\">Saving current state of unstaged changes to tracked files</a></li>\n<li><a href=\"#saving-current-state-including-untracked-files\">Saving current state including untracked files</a></li>\n<li><a href=\"#saving-current-state-with-message\">Saving current state with message</a></li>\n<li><a href=\"#saving-current-state-of-all-files-ignored-untracked-and-tracked\">Saving current state of all files (ignored, untracked, and tracked)</a></li>\n<li><a href=\"#show-list-of-all-saved-stashes\">Show list of all saved stashes</a></li>\n<li><a href=\"#show-the-contents-of-any-stash-in-patch-form\">Show the contents of any stash in patch form</a></li>\n<li><a href=\"#apply-any-stash-without-deleting-from-the-stashed-list\">Apply any stash without deleting from the stashed list</a></li>\n<li><a href=\"#apply-last-stashed-state-and-delete-it-from-stashed-list\">Apply last stashed state and delete it from stashed list</a></li>\n<li><a href=\"#delete-all-stored-stashes\">Delete all stored stashes</a></li>\n<li><a href=\"#grab-a-single-file-from-a-stash\">Grab a single file from a stash</a></li>\n<li><a href=\"#show-all-tracked-files\">Show all tracked files</a></li>\n<li><a href=\"#show-all-untracked-files\">Show all untracked files</a></li>\n<li><a href=\"#show-all-ignored-files\">Show all ignored files</a></li>\n<li><a href=\"#create-new-working-tree-from-a-repository-git-25\">Create new working tree from a repository (git 2.5)</a></li>\n<li><a href=\"#create-new-working-tree-from-head-state\">Create new working tree from HEAD state</a></li>\n<li><a href=\"#untrack-files-without-deleting\">Untrack files without deleting</a></li>\n<li><a href=\"#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories\">Before deleting untracked files/directory, do a dry run to get the list of these files/directories</a></li>\n<li><a href=\"#forcefully-remove-untracked-files\">Forcefully remove untracked files</a></li>\n<li><a href=\"#forcefully-remove-untracked-directory\">Forcefully remove untracked directory</a></li>\n<li><a href=\"#update-all-the-submodules\">Update all the submodules</a></li>\n<li><a href=\"#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master\">Show all commits in the current branch yet to be merged to master</a></li>\n<li><a href=\"#rename-a-branch\">Rename a branch</a></li>\n<li><a href=\"#rebases-feature-to-master-and-merges-it-in-to-master\">Rebases 'feature' to 'master' and merges it in to master </a></li>\n<li><a href=\"#archive-the-master-branch\">Archive the <code>master</code> branch</a></li>\n<li><a href=\"#modify-previous-commit-without-modifying-the-commit-message\">Modify previous commit without modifying the commit message</a></li>\n<li><a href=\"#prunes-references-to-remove-branches-that-have-been-deleted-in-the-remote\">Prunes references to remove branches that have been deleted in the remote.</a></li>\n<li><a href=\"#delete-local-branches-that-has-been-squash-and-merged-in-the-remote\">Delete local branches that has been squash and merged in the remote.</a></li>\n<li><a href=\"#retrieve-the-commit-hash-of-the-initial-revision\">Retrieve the commit hash of the initial revision.</a></li>\n<li><a href=\"#visualize-the-version-tree\">Visualize the version tree.</a></li>\n<li><a href=\"#visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs\">Visualize the tree including commits that are only referenced from reflogs</a></li>\n<li><a href=\"#deploying-git-tracked-subfolder-to-gh-pages\">Deploying git tracked subfolder to gh-pages</a></li>\n<li><a href=\"#adding-a-project-to-repo-using-subtree\">Adding a project to repo using subtree</a></li>\n<li><a href=\"#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree\">Get latest changes in your repo for a linked project using subtree</a></li>\n<li><a href=\"#export-a-branch-with-history-to-a-file\">Export a branch with history to a file.</a></li>\n<li><a href=\"#import-from-a-bundle\">Import from a bundle</a></li>\n<li><a href=\"#get-the-name-of-current-branch\">Get the name of current branch.</a></li>\n<li><a href=\"#ignore-one-file-on-commit-eg-changelog\">Ignore one file on commit (e.g. Changelog).</a></li>\n<li><a href=\"#stash-changes-before-rebasing\">Stash changes before rebasing</a></li>\n<li><a href=\"#fetch-pull-request-by-id-to-a-local-branch\">Fetch pull request by ID to a local branch</a></li>\n<li><a href=\"#show-the-most-recent-tag-on-the-current-branch\">Show the most recent tag on the current branch.</a></li>\n<li><a href=\"#show-inline-word-diff\">Show inline word diff.</a></li>\n<li><a href=\"#show-changes-using-common-diff-tools\">Show changes using common diff tools.</a></li>\n<li><a href=\"#dont-consider-changes-for-tracked-file\">Don’t consider changes for tracked file.</a></li>\n<li><a href=\"#undo-assume-unchanged\">Undo assume-unchanged.</a></li>\n<li><a href=\"#clean-the-files-from-gitignore\">Clean the files from <code>.gitignore</code>.</a></li>\n<li><a href=\"#restore-deleted-file\">Restore deleted file.</a></li>\n<li><a href=\"#restore-file-to-a-specific-commit-hash\">Restore file to a specific commit-hash</a></li>\n<li><a href=\"#always-rebase-instead-of-merge-on-pull\">Always rebase instead of merge on pull.</a></li>\n<li><a href=\"#list-all-the-alias-and-configs\">List all the alias and configs.</a></li>\n<li><a href=\"#make-git-case-sensitive\">Make git case sensitive.</a></li>\n<li><a href=\"#add-custom-editors\">Add custom editors.</a></li>\n<li><a href=\"#auto-correct-typos\">Auto correct typos.</a></li>\n<li><a href=\"#check-if-the-change-was-a-part-of-a-release\">Check if the change was a part of a release.</a></li>\n<li><a href=\"#dry-run-any-command-that-supports-dry-run-flag-should-do\">Dry run. (any command that supports dry-run flag should do.)</a></li>\n<li><a href=\"#marks-your-commit-as-a-fix-of-a-previous-commit\">Marks your commit as a fix of a previous commit.</a></li>\n<li><a href=\"#squash-fixup-commits-normal-commits\">Squash fixup commits normal commits.</a></li>\n<li><a href=\"#skip-staging-area-during-commit\">Skip staging area during commit.</a></li>\n<li><a href=\"#interactive-staging\">Interactive staging.</a></li>\n<li><a href=\"#list-ignored-files\">List ignored files.</a></li>\n<li><a href=\"#status-of-ignored-files\">Status of ignored files.</a></li>\n<li><a href=\"#commits-in-branch1-that-are-not-in-branch2\">Commits in Branch1 that are not in Branch2</a></li>\n<li><a href=\"#list-n-last-commits\">List n last commits</a></li>\n<li><a href=\"#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions\">Reuse recorded resolution, record and reuse previous conflicts resolutions.</a></li>\n<li><a href=\"#open-all-conflicted-files-in-an-editor\">Open all conflicted files in an editor.</a></li>\n<li><a href=\"#count-unpacked-number-of-objects-and-their-disk-consumption\">Count unpacked number of objects and their disk consumption.</a></li>\n<li><a href=\"#prune-all-unreachable-objects-from-the-object-database\">Prune all unreachable objects from the object database.</a></li>\n<li><a href=\"#instantly-browse-your-working-repository-in-gitweb\">Instantly browse your working repository in gitweb.</a></li>\n<li><a href=\"#view-the-gpg-signatures-in-the-commit-log\">View the GPG signatures in the commit log</a></li>\n<li><a href=\"#remove-entry-in-the-global-config\">Remove entry in the global config.</a></li>\n<li><a href=\"#checkout-a-new-branch-without-any-history\">Checkout a new branch without any history</a></li>\n<li><a href=\"#extract-file-from-another-branch\">Extract file from another branch.</a></li>\n<li><a href=\"#list-only-the-root-and-merge-commits\">List only the root and merge commits.</a></li>\n<li><a href=\"#change-previous-two-commits-with-an-interactive-rebase\">Change previous two commits with an interactive rebase.</a></li>\n<li><a href=\"#list-all-branch-is-wip\">List all branch is WIP</a></li>\n<li><a href=\"#find-guilty-with-binary-search\">Find guilty with binary search</a></li>\n<li><a href=\"#bypass-pre-commit-and-commit-msg-githooks\">Bypass pre-commit and commit-msg githooks</a></li>\n<li><a href=\"#list-commits-and-changes-to-a-specific-file-even-through-renaming\">List commits and changes to a specific file (even through renaming)</a></li>\n<li><a href=\"#clone-a-single-branch\">Clone a single branch</a></li>\n<li><a href=\"#create-and-switch-new-branch\">Create and switch new branch</a></li>\n<li><a href=\"#ignore-file-mode-changes-on-commits\">Ignore file mode changes on commits</a></li>\n<li><a href=\"#turn-off-git-colored-terminal-output\">Turn off git colored terminal output</a></li>\n<li><a href=\"#specific-color-settings\">Specific color settings</a></li>\n<li><a href=\"#show-all-local-branches-ordered-by-recent-commits\">Show all local branches ordered by recent commits</a></li>\n<li><a href=\"#find-lines-matching-the-pattern-regex-or-string-in-tracked-files\">Find lines matching the pattern (regex or string) in tracked files</a></li>\n<li><a href=\"#clone-a-shallow-copy-of-a-repository\">Clone a shallow copy of a repository</a></li>\n<li><a href=\"#search-commit-log-across-all-branches-for-given-text\">Search Commit log across all branches for given text</a></li>\n<li><a href=\"#get-first-commit-in-a-branch-from-master\">Get first commit in a branch (from master)</a></li>\n<li><a href=\"#unstaging-staged-file\">Unstaging Staged file</a></li>\n<li><a href=\"#force-push-to-remote-repository\">Force push to Remote Repository</a></li>\n<li><a href=\"#adding-remote-name\">Adding Remote name</a></li>\n<li><a href=\"#list-all-currently-configured-remotes\">List all currently configured remotes</a></li>\n<li><a href=\"#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file\">Show the author, time and last revision made to each line of a given file</a></li>\n<li><a href=\"#group-commits-by-authors-and-title\">Group commits by authors and title</a></li>\n<li><a href=\"#forced-push-but-still-ensure-you-dont-overwrite-others-work\">Forced push but still ensure you don't overwrite other's work</a></li>\n<li><a href=\"#show-how-many-lines-does-an-author-contribute\">Show how many lines does an author contribute</a></li>\n<li><a href=\"#revert-reverting-an-entire-merge\">Revert: Reverting an entire merge</a></li>\n<li><a href=\"#number-of-commits-in-a-branch\">Number of commits in a branch</a></li>\n<li><a href=\"#alias-git-undo\">Alias: git undo</a></li>\n<li><a href=\"#add-object-notes\">Add object notes</a></li>\n<li><a href=\"#show-all-the-git-notes\">Show all the git-notes</a></li>\n<li><a href=\"#apply-commit-from-another-repository\">Apply commit from another repository</a></li>\n<li><a href=\"#specific-fetch-reference\">Specific fetch reference</a></li>\n<li><a href=\"#find-common-ancestor-of-two-branches\">Find common ancestor of two branches</a></li>\n<li><a href=\"#list-unpushed-git-commits\">List unpushed git commits</a></li>\n<li><a href=\"#add-everything-but-whitespace-changes\">Add everything, but whitespace changes</a></li>\n<li><a href=\"#edit-localglobal-git-config\">Edit [local/global] git config</a></li>\n<li><a href=\"#blame-on-certain-range\">blame on certain range</a></li>\n<li><a href=\"#show-a-git-logical-variable\">Show a Git logical variable.</a></li>\n<li><a href=\"#preformatted-patch-file\">Preformatted patch file.</a></li>\n<li><a href=\"#get-the-repo-name\">Get the repo name.</a></li>\n<li><a href=\"#logs-between-date-range\">logs between date range</a></li>\n<li><a href=\"#exclude-author-from-logs\">Exclude author from logs</a></li>\n<li><a href=\"#generates-a-summary-of-pending-changes\">Generates a summary of pending changes</a></li>\n<li><a href=\"#list-references-in-a-remote-repository\">List references in a remote repository</a></li>\n<li><a href=\"#backup-untracked-files\">Backup untracked files.</a></li>\n<li><a href=\"#list-all-git-aliases\">List all git aliases</a></li>\n<li><a href=\"#show-git-status-short\">Show git status short</a></li>\n<li><a href=\"#checkout-a-commit-prior-to-a-day-ago\">Checkout a commit prior to a day ago</a></li>\n<li><a href=\"#push-the-current-branch-to-the-same-name-on-the-remote-repository\">Push the current branch to the same name on the remote repository</a></li>\n<li><a href=\"#push-a-new-local-branch-to-remote-repository-and-track\">Push a new local branch to remote repository and track</a></li>\n<li><a href=\"#change-a-branch-base\">Change a branch base</a></li>\n<li><a href=\"#use-ssh-instead-of-https-for-remotes\">Use SSH instead of HTTPs for remotes</a></li>\n<li><a href=\"#update-a-submodule-to-the-latest-commit\">Update a submodule to the latest commit</a></li>\n<li><a href=\"#prevent-auto-replacing-lf-with-crlf\">Prevent auto replacing LF with CRLF</a></li>\n</ul>\n\n\n\n\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-everyday-git-in-twenty-commands-or-so\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#everyday-git-in-twenty-commands-or-so\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Everyday Git in twenty commands or so</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git help everyday\"><pre>git <span class=\"pl-c1\">help</span> everyday</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-helpful-guides-that-come-with-git\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-helpful-guides-that-come-with-git\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show helpful guides that come with Git</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git help -g\"><pre>git <span class=\"pl-c1\">help</span> -g</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-search-change-by-content\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#search-change-by-content\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Search change by content</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log -S'&lt;a term in the source&gt;'\"><pre>git log -S<span class=\"pl-s\"><span class=\"pl-pds\">'</span>&lt;a term in the source&gt;<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-changes-over-time-for-specific-file\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-changes-over-time-for-specific-file\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show changes over time for specific file</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log -p &lt;file_name&gt;\"><pre>git log -p <span class=\"pl-k\">&lt;</span>file_name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-remove-sensitive-data-from-history-after-a-push\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#remove-sensitive-data-from-history-after-a-push\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Remove sensitive data from history, after a push</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch &lt;path-to-your-file&gt;' --prune-empty --tag-name-filter cat -- --all &amp;&amp; git push origin --force --all\"><pre>git filter-branch --force --index-filter <span class=\"pl-s\"><span class=\"pl-pds\">'</span>git rm --cached --ignore-unmatch &lt;path-to-your-file&gt;<span class=\"pl-pds\">'</span></span> --prune-empty --tag-name-filter cat -- --all <span class=\"pl-k\">&amp;&amp;</span> git push origin --force --all</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-sync-with-remote-overwrite-local-changes\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#sync-with-remote-overwrite-local-changes\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Sync with remote, overwrite local changes</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git fetch origin &amp;&amp; git reset --hard origin/master &amp;&amp; git clean -f -d\"><pre>git fetch origin <span class=\"pl-k\">&amp;&amp;</span> git reset --hard origin/master <span class=\"pl-k\">&amp;&amp;</span> git clean -f -d</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-of-all-files-till-a-commit\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-of-all-files-till-a-commit\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List of all files till a commit</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git ls-tree --name-only -r &lt;commit-ish&gt;\"><pre>git ls-tree --name-only -r <span class=\"pl-k\">&lt;</span>commit-ish<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-git-reset-first-commit\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#git-reset-first-commit\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Git reset first commit</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git update-ref -d HEAD\"><pre>git update-ref -d HEAD</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-reset-preserve-uncommitted-local-changes\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#reset-preserve-uncommitted-local-changes\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Reset: preserve uncommitted local changes</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git reset --keep &lt;commit&gt;\"><pre>git reset --keep <span class=\"pl-k\">&lt;</span>commit<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-all-the-conflicted-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-all-the-conflicted-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List all the conflicted files</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git diff --name-only --diff-filter=U\"><pre>git diff --name-only --diff-filter=U</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-of-all-files-changed-in-a-commit\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-of-all-files-changed-in-a-commit\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List of all files changed in a commit</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git diff-tree --no-commit-id --name-only -r &lt;commit-ish&gt;\"><pre>git diff-tree --no-commit-id --name-only -r <span class=\"pl-k\">&lt;</span>commit-ish<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-unstaged-changes-since-last-commit\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#unstaged-changes-since-last-commit\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Unstaged changes since last commit</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git diff\"><pre>git diff</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-changes-staged-for-commit\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#changes-staged-for-commit\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Changes staged for commit</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git diff --cached\"><pre>git diff --cached</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git diff --staged\"><pre>git diff --staged</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-both-staged-and-unstaged-changes\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-both-staged-and-unstaged-changes\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show both staged and unstaged changes</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git diff HEAD\"><pre>git diff HEAD</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-all-branches-that-are-already-merged-into-master\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-all-branches-that-are-already-merged-into-master\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List all branches that are already merged into master</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch --merged master\"><pre>git branch --merged master</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-quickly-switch-to-the-previous-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#quickly-switch-to-the-previous-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Quickly switch to the previous branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout -\"><pre>git checkout -</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout @{-1}\"><pre>git checkout @{-1}</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-remove-branches-that-have-already-been-merged-with-master\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#remove-branches-that-have-already-been-merged-with-master\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Remove branches that have already been merged with master</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d\"><pre>git branch --merged master <span class=\"pl-k\">|</span> grep -v <span class=\"pl-s\"><span class=\"pl-pds\">'</span>^\\*<span class=\"pl-pds\">'</span></span> <span class=\"pl-k\">|</span> xargs -n 1 git branch -d</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch --merged master | grep -v '^\\*\\| master' | xargs -n 1 git branch -d # will not delete master if master is not checked out\"><pre>git branch --merged master <span class=\"pl-k\">|</span> grep -v <span class=\"pl-s\"><span class=\"pl-pds\">'</span>^\\*\\| master<span class=\"pl-pds\">'</span></span> <span class=\"pl-k\">|</span> xargs -n 1 git branch -d <span class=\"pl-c\"><span class=\"pl-c\">#</span> will not delete master if master is not checked out</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-all-branches-and-their-upstreams-as-well-as-last-commit-on-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List all branches and their upstreams, as well as last commit on branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -vv\"><pre>git branch -vv</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-track-upstream-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#track-upstream-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Track upstream branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -u origin/mybranch\"><pre>git branch -u origin/mybranch</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-delete-local-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#delete-local-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Delete local branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -d &lt;local_branchname&gt;\"><pre>git branch -d <span class=\"pl-k\">&lt;</span>local_branchname<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-delete-remote-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#delete-remote-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Delete remote branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git push origin --delete &lt;remote_branchname&gt;\"><pre>git push origin --delete <span class=\"pl-k\">&lt;</span>remote_branchname<span class=\"pl-k\">&gt;</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git push origin :&lt;remote_branchname&gt;\"><pre>git push origin :<span class=\"pl-k\">&lt;</span>remote_branchname<span class=\"pl-k\">&gt;</span></pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -dr &lt;remote/branch&gt;\"><pre>git branch -dr <span class=\"pl-k\">&lt;</span>remote/branch<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-create-local-tag\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#create-local-tag\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Create local tag</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git tag &lt;tag-name&gt;\"><pre>git tag <span class=\"pl-k\">&lt;</span>tag-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-delete-local-tag\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#delete-local-tag\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Delete local tag</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git tag -d &lt;tag-name&gt;\"><pre>git tag -d <span class=\"pl-k\">&lt;</span>tag-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-delete-remote-tag\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#delete-remote-tag\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Delete remote tag</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git push origin :refs/tags/&lt;tag-name&gt;\"><pre>git push origin :refs/tags/<span class=\"pl-k\">&lt;</span>tag-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-undo-local-changes-with-the-content-in-indexstaging\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#undo-local-changes-with-the-content-in-indexstaging\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Undo local changes with the content in index(staging)</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout -- &lt;file_name&gt;\"><pre>git checkout -- <span class=\"pl-k\">&lt;</span>file_name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-revert-undo-a-commit-by-creating-a-new-commit\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#revert-undo-a-commit-by-creating-a-new-commit\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Revert: Undo a commit by creating a new commit</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git revert &lt;commit-ish&gt;\"><pre>git revert <span class=\"pl-k\">&lt;</span>commit-ish<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-reset-discard-commits-advised-for-private-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#reset-discard-commits-advised-for-private-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Reset: Discard commits, advised for private branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git reset &lt;commit-ish&gt;\"><pre>git reset <span class=\"pl-k\">&lt;</span>commit-ish<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-reword-the-previous-commit-message\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#reword-the-previous-commit-message\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Reword the previous commit message</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git commit -v --amend\"><pre>git commit -v --amend</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-see-commit-history-for-just-the-current-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#see-commit-history-for-just-the-current-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>See commit history for just the current branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git cherry -v master\"><pre>git cherry -v master</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-amend-author\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#amend-author\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Amend author.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git commit --amend --author='Author Name &lt;[email protected]&gt;'\"><pre>git commit --amend --author=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>Author Name &lt;[email protected]&gt;<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-reset-author-after-author-has-been-changed-in-the-global-config\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#reset-author-after-author-has-been-changed-in-the-global-config\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Reset author, after author has been changed in the global config.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git commit --amend --reset-author --no-edit\"><pre>git commit --amend --reset-author --no-edit</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-changing-a-remotes-url\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#changing-a-remotes-url\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Changing a remote's URL</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git remote set-url origin &lt;URL&gt;\"><pre>git remote set-url origin <span class=\"pl-k\">&lt;</span>URL<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-get-list-of-all-remote-references\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#get-list-of-all-remote-references\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Get list of all remote references</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git remote\"><pre>git remote</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git remote show\"><pre>git remote show</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-get-list-of-all-local-and-remote-branches\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#get-list-of-all-local-and-remote-branches\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Get list of all local and remote branches</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -a\"><pre>git branch -a</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-get-only-remote-branches\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#get-only-remote-branches\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Get only remote branches</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -r\"><pre>git branch -r</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-stage-parts-of-a-changed-file-instead-of-the-entire-file\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#stage-parts-of-a-changed-file-instead-of-the-entire-file\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Stage parts of a changed file, instead of the entire file</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git add -p\"><pre>git add -p</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-get-git-bash-completion\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#get-git-bash-completion\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Get git bash completion</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"curl -L http://git.io/vfhol &gt; ~/.git-completion.bash &amp;&amp; echo '[ -f ~/.git-completion.bash ] &amp;&amp; . ~/.git-completion.bash' &gt;&gt; ~/.bashrc\"><pre>curl -L http://git.io/vfhol <span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">~</span>/.git-completion.bash <span class=\"pl-k\">&amp;&amp;</span> <span class=\"pl-c1\">echo</span> <span class=\"pl-s\"><span class=\"pl-pds\">'</span>[ -f ~/.git-completion.bash ] &amp;&amp; . ~/.git-completion.bash<span class=\"pl-pds\">'</span></span> <span class=\"pl-k\">&gt;&gt;</span> <span class=\"pl-k\">~</span>/.bashrc</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-what-changed-since-two-weeks\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#what-changed-since-two-weeks\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>What changed since two weeks?</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --no-merges --raw --since='2 weeks ago'\"><pre>git log --no-merges --raw --since=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>2 weeks ago<span class=\"pl-pds\">'</span></span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git whatchanged --since='2 weeks ago'\"><pre>git whatchanged --since=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>2 weeks ago<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-see-all-commits-made-since-forking-from-master\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#see-all-commits-made-since-forking-from-master\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>See all commits made since forking from master</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --no-merges --stat --reverse master..\"><pre>git log --no-merges --stat --reverse master..</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-pick-commits-across-branches-using-cherry-pick\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#pick-commits-across-branches-using-cherry-pick\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Pick commits across branches using cherry-pick</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout &lt;branch-name&gt; &amp;&amp; git cherry-pick &lt;commit-ish&gt;\"><pre>git checkout <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&amp;&amp;</span> git cherry-pick <span class=\"pl-k\">&lt;</span>commit-ish<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-find-out-branches-containing-commit-hash\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#find-out-branches-containing-commit-hash\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Find out branches containing commit-hash</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -a --contains &lt;commit-ish&gt;\"><pre>git branch -a --contains <span class=\"pl-k\">&lt;</span>commit-ish<span class=\"pl-k\">&gt;</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch --contains &lt;commit-ish&gt;\"><pre>git branch --contains <span class=\"pl-k\">&lt;</span>commit-ish<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-git-aliases\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#git-aliases\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Git Aliases</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global alias.&lt;handle&gt; &lt;command&gt; \ngit config --global alias.st status\"><pre>git config --global alias.<span class=\"pl-k\">&lt;</span>handle<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&lt;</span>command<span class=\"pl-k\">&gt;</span> \ngit config --global alias.st status</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-saving-current-state-of-tracked-files-without-commiting\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#saving-current-state-of-tracked-files-without-commiting\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Saving current state of tracked files without commiting</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash\"><pre>git stash</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash push\"><pre>git stash push</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-saving-current-state-of-unstaged-changes-to-tracked-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#saving-current-state-of-unstaged-changes-to-tracked-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Saving current state of unstaged changes to tracked files</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash -k\"><pre>git stash -k</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash --keep-index\"><pre>git stash --keep-index</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash push --keep-index\"><pre>git stash push --keep-index</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-saving-current-state-including-untracked-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#saving-current-state-including-untracked-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Saving current state including untracked files</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash -u\"><pre>git stash -u</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash push -u\"><pre>git stash push -u</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash push --include-untracked\"><pre>git stash push --include-untracked</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-saving-current-state-with-message\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#saving-current-state-with-message\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Saving current state with message</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash push -m &lt;message&gt;\"><pre>git stash push -m <span class=\"pl-k\">&lt;</span>message<span class=\"pl-k\">&gt;</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash push --message &lt;message&gt;\"><pre>git stash push --message <span class=\"pl-k\">&lt;</span>message<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-saving-current-state-of-all-files-ignored-untracked-and-tracked\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#saving-current-state-of-all-files-ignored-untracked-and-tracked\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Saving current state of all files (ignored, untracked, and tracked)</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash -a\"><pre>git stash -a</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash --all\"><pre>git stash --all</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash push --all\"><pre>git stash push --all</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-list-of-all-saved-stashes\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-list-of-all-saved-stashes\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show list of all saved stashes</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash list\"><pre>git stash list</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-the-contents-of-any-stash-in-patch-form\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-the-contents-of-any-stash-in-patch-form\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show the contents of any stash in patch form</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash show -p &lt;stash@{n}&gt;\"><pre>git stash show -p <span class=\"pl-k\">&lt;</span>stash@{n}<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-apply-any-stash-without-deleting-from-the-stashed-list\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#apply-any-stash-without-deleting-from-the-stashed-list\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Apply any stash without deleting from the stashed list</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash apply &lt;stash@{n}&gt;\"><pre>git stash apply <span class=\"pl-k\">&lt;</span>stash@{n}<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-apply-last-stashed-state-and-delete-it-from-stashed-list\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#apply-last-stashed-state-and-delete-it-from-stashed-list\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Apply last stashed state and delete it from stashed list</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash pop\"><pre>git stash pop</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash apply stash@{0} &amp;&amp; git stash drop stash@{0}\"><pre>git stash apply stash@{0} <span class=\"pl-k\">&amp;&amp;</span> git stash drop stash@{0}</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-delete-all-stored-stashes\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#delete-all-stored-stashes\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Delete all stored stashes</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash clear\"><pre>git stash clear</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git stash drop &lt;stash@{n}&gt;\"><pre>git stash drop <span class=\"pl-k\">&lt;</span>stash@{n}<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-grab-a-single-file-from-a-stash\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#grab-a-single-file-from-a-stash\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Grab a single file from a stash</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout &lt;stash@{n}&gt; -- &lt;file_path&gt;\"><pre>git checkout <span class=\"pl-k\">&lt;</span>stash@{n}<span class=\"pl-k\">&gt;</span> -- <span class=\"pl-k\">&lt;</span>file_path<span class=\"pl-k\">&gt;</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout stash@{0} -- &lt;file_path&gt;\"><pre>git checkout stash@{0} -- <span class=\"pl-k\">&lt;</span>file_path<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-all-tracked-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-all-tracked-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show all tracked files</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git ls-files -t\"><pre>git ls-files -t</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-all-untracked-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-all-untracked-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show all untracked files</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git ls-files --others\"><pre>git ls-files --others</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-all-ignored-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-all-ignored-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show all ignored files</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git ls-files --others -i --exclude-standard\"><pre>git ls-files --others -i --exclude-standard</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-create-new-working-tree-from-a-repository-git-25\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#create-new-working-tree-from-a-repository-git-25\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Create new working tree from a repository (git 2.5)</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git worktree add -b &lt;branch-name&gt; &lt;path&gt; &lt;start-point&gt;\"><pre>git worktree add -b <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&lt;</span>path<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&lt;</span>start-point<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-create-new-working-tree-from-head-state\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#create-new-working-tree-from-head-state\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Create new working tree from HEAD state</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git worktree add --detach &lt;path&gt; HEAD\"><pre>git worktree add --detach <span class=\"pl-k\">&lt;</span>path<span class=\"pl-k\">&gt;</span> HEAD</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-untrack-files-without-deleting\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#untrack-files-without-deleting\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Untrack files without deleting</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git rm --cached &lt;file_path&gt;\"><pre>git rm --cached <span class=\"pl-k\">&lt;</span>file_path<span class=\"pl-k\">&gt;</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git rm --cached -r &lt;directory_path&gt;\"><pre>git rm --cached -r <span class=\"pl-k\">&lt;</span>directory_path<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Before deleting untracked files/directory, do a dry run to get the list of these files/directories</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clean -n\"><pre>git clean -n</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-forcefully-remove-untracked-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#forcefully-remove-untracked-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Forcefully remove untracked files</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clean -f\"><pre>git clean -f</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-forcefully-remove-untracked-directory\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#forcefully-remove-untracked-directory\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Forcefully remove untracked directory</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clean -f -d\"><pre>git clean -f -d</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-update-all-the-submodules\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#update-all-the-submodules\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Update all the submodules</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git submodule foreach git pull\"><pre>git submodule foreach git pull</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git submodule update --init --recursive\"><pre>git submodule update --init --recursive</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git submodule update --remote\"><pre>git submodule update --remote</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-all-commits-in-the-current-branch-yet-to-be-merged-to-master\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show all commits in the current branch yet to be merged to master</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git cherry -v master\"><pre>git cherry -v master</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git cherry -v master &lt;branch-to-be-merged&gt;\"><pre>git cherry -v master <span class=\"pl-k\">&lt;</span>branch-to-be-merged<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-rename-a-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#rename-a-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Rename a branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -m &lt;new-branch-name&gt;\"><pre>git branch -m <span class=\"pl-k\">&lt;</span>new-branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -m [&lt;old-branch-name&gt;] &lt;new-branch-name&gt;\"><pre>git branch -m [<span class=\"pl-k\">&lt;</span>old-branch-name<span class=\"pl-k\">&gt;</span>] <span class=\"pl-k\">&lt;</span>new-branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-rebases-feature-to-master-and-merges-it-in-to-master\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#rebases-feature-to-master-and-merges-it-in-to-master\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Rebases 'feature' to 'master' and merges it in to master</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git rebase master feature &amp;&amp; git checkout master &amp;&amp; git merge -\"><pre>git rebase master feature <span class=\"pl-k\">&amp;&amp;</span> git checkout master <span class=\"pl-k\">&amp;&amp;</span> git merge -</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-archive-the-master-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#archive-the-master-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Archive the <code>master</code> branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git archive master --format=zip --output=master.zip\"><pre>git archive master --format=zip --output=master.zip</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-modify-previous-commit-without-modifying-the-commit-message\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#modify-previous-commit-without-modifying-the-commit-message\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Modify previous commit without modifying the commit message</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git add --all &amp;&amp; git commit --amend --no-edit\"><pre>git add --all <span class=\"pl-k\">&amp;&amp;</span> git commit --amend --no-edit</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-prunes-references-to-remove-branches-that-have-been-deleted-in-the-remote\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#prunes-references-to-remove-branches-that-have-been-deleted-in-the-remote\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Prunes references to remove branches that have been deleted in the remote.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git fetch -p\"><pre>git fetch -p</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git remote prune origin\"><pre>git remote prune origin</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-delete-local-branches-that-has-been-squash-and-merged-in-the-remote\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#delete-local-branches-that-has-been-squash-and-merged-in-the-remote\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Delete local branches that has been squash and merged in the remote.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch -vv | grep ': gone]' | awk '{print &lt;!-- @doxie.inject start --&gt;}' | xargs git branch -D\"><pre>git branch -vv <span class=\"pl-k\">|</span> grep <span class=\"pl-s\"><span class=\"pl-pds\">'</span>: gone]<span class=\"pl-pds\">'</span></span> <span class=\"pl-k\">|</span> awk <span class=\"pl-s\"><span class=\"pl-pds\">'</span>{print &lt;!-- @doxie.inject start --&gt;}<span class=\"pl-pds\">'</span></span> <span class=\"pl-k\">|</span> xargs git branch -D</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-retrieve-the-commit-hash-of-the-initial-revision\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#retrieve-the-commit-hash-of-the-initial-revision\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Retrieve the commit hash of the initial revision.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\" git rev-list --reverse HEAD | head -1\"><pre> git rev-list --reverse HEAD <span class=\"pl-k\">|</span> head -1</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git rev-list --max-parents=0 HEAD\"><pre>git rev-list --max-parents=0 HEAD</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --pretty=oneline | tail -1 | cut -c 1-40\"><pre>git log --pretty=oneline <span class=\"pl-k\">|</span> tail -1 <span class=\"pl-k\">|</span> cut -c 1-40</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --pretty=oneline --reverse | head -1 | cut -c 1-40\"><pre>git log --pretty=oneline --reverse <span class=\"pl-k\">|</span> head -1 <span class=\"pl-k\">|</span> cut -c 1-40</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-visualize-the-version-tree\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#visualize-the-version-tree\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Visualize the version tree.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --pretty=oneline --graph --decorate --all\"><pre>git log --pretty=oneline --graph --decorate --all</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"gitk --all\"><pre>gitk --all</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d'\"><pre>git log --graph --pretty=format:<span class=\"pl-s\"><span class=\"pl-pds\">'</span>%C(auto) %h | %s | %an | %ar%d<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Visualize the tree including commits that are only referenced from reflogs</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --graph --decorate --oneline $(git rev-list --walk-reflogs --all)\"><pre>git log --graph --decorate --oneline <span class=\"pl-s\"><span class=\"pl-pds\">$(</span>git rev-list --walk-reflogs --all<span class=\"pl-pds\">)</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-deploying-git-tracked-subfolder-to-gh-pages\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#deploying-git-tracked-subfolder-to-gh-pages\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Deploying git tracked subfolder to gh-pages</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git subtree push --prefix subfolder_name origin gh-pages\"><pre>git subtree push --prefix subfolder_name origin gh-pages</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-adding-a-project-to-repo-using-subtree\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#adding-a-project-to-repo-using-subtree\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Adding a project to repo using subtree</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git subtree add --prefix=&lt;directory_name&gt;/&lt;project_name&gt; --squash [email protected]:&lt;username&gt;/&lt;project_name&gt;.git master\"><pre>git subtree add --prefix=<span class=\"pl-k\">&lt;</span>directory_name<span class=\"pl-k\">&gt;</span>/<span class=\"pl-k\">&lt;</span>project_name<span class=\"pl-k\">&gt;</span> --squash [email protected]:<span class=\"pl-k\">&lt;</span>username<span class=\"pl-k\">&gt;</span>/<span class=\"pl-k\">&lt;</span>project_name<span class=\"pl-k\">&gt;</span>.git master</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-get-latest-changes-in-your-repo-for-a-linked-project-using-subtree\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Get latest changes in your repo for a linked project using subtree</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git subtree pull --prefix=&lt;directory_name&gt;/&lt;project_name&gt; --squash [email protected]:&lt;username&gt;/&lt;project_name&gt;.git master\"><pre>git subtree pull --prefix=<span class=\"pl-k\">&lt;</span>directory_name<span class=\"pl-k\">&gt;</span>/<span class=\"pl-k\">&lt;</span>project_name<span class=\"pl-k\">&gt;</span> --squash [email protected]:<span class=\"pl-k\">&lt;</span>username<span class=\"pl-k\">&gt;</span>/<span class=\"pl-k\">&lt;</span>project_name<span class=\"pl-k\">&gt;</span>.git master</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-export-a-branch-with-history-to-a-file\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#export-a-branch-with-history-to-a-file\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Export a branch with history to a file.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git bundle create &lt;file&gt; &lt;branch-name&gt;\"><pre>git bundle create <span class=\"pl-k\">&lt;</span>file<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-import-from-a-bundle\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#import-from-a-bundle\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Import from a bundle</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clone repo.bundle &lt;repo-dir&gt; -b &lt;branch-name&gt;\"><pre>git clone repo.bundle <span class=\"pl-k\">&lt;</span>repo-dir<span class=\"pl-k\">&gt;</span> -b <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-get-the-name-of-current-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#get-the-name-of-current-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Get the name of current branch.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git rev-parse --abbrev-ref HEAD\"><pre>git rev-parse --abbrev-ref HEAD</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-ignore-one-file-on-commit-eg-changelog\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#ignore-one-file-on-commit-eg-changelog\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Ignore one file on commit (e.g. Changelog).</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog\"><pre>git update-index --assume-unchanged Changelog<span class=\"pl-k\">;</span> git commit -a<span class=\"pl-k\">;</span> git update-index --no-assume-unchanged Changelog</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-stash-changes-before-rebasing\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#stash-changes-before-rebasing\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Stash changes before rebasing</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git rebase --autostash\"><pre>git rebase --autostash</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-fetch-pull-request-by-id-to-a-local-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#fetch-pull-request-by-id-to-a-local-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Fetch pull request by ID to a local branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git fetch origin pull/&lt;id&gt;/head:&lt;branch-name&gt;\"><pre>git fetch origin pull/<span class=\"pl-k\">&lt;</span>id<span class=\"pl-k\">&gt;</span>/head:<span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git pull origin pull/&lt;id&gt;/head:&lt;branch-name&gt;\"><pre>git pull origin pull/<span class=\"pl-k\">&lt;</span>id<span class=\"pl-k\">&gt;</span>/head:<span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-the-most-recent-tag-on-the-current-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-the-most-recent-tag-on-the-current-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show the most recent tag on the current branch.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git describe --tags --abbrev=0\"><pre>git describe --tags --abbrev=0</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-inline-word-diff\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-inline-word-diff\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show inline word diff.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git diff --word-diff\"><pre>git diff --word-diff</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-changes-using-common-diff-tools\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-changes-using-common-diff-tools\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show changes using common diff tools.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git difftool [-t &lt;tool&gt;] &lt;commit1&gt; &lt;commit2&gt; &lt;path&gt;\"><pre>git difftool [-t <span class=\"pl-k\">&lt;</span>tool<span class=\"pl-k\">&gt;</span>] <span class=\"pl-k\">&lt;</span>commit<span class=\"pl-k\">1&gt;</span> <span class=\"pl-k\">&lt;</span>commit<span class=\"pl-k\">2&gt;</span> <span class=\"pl-k\">&lt;</span>path<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-dont-consider-changes-for-tracked-file\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#dont-consider-changes-for-tracked-file\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Don’t consider changes for tracked file.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git update-index --assume-unchanged &lt;file_name&gt;\"><pre>git update-index --assume-unchanged <span class=\"pl-k\">&lt;</span>file_name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-undo-assume-unchanged\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#undo-assume-unchanged\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Undo assume-unchanged.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git update-index --no-assume-unchanged &lt;file_name&gt;\"><pre>git update-index --no-assume-unchanged <span class=\"pl-k\">&lt;</span>file_name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-clean-the-files-from-gitignore\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#clean-the-files-from-gitignore\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Clean the files from <code>.gitignore</code>.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clean -X -f\"><pre>git clean -X -f</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-restore-deleted-file\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#restore-deleted-file\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Restore deleted file.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout &lt;deleting_commit&gt; -- &lt;file_path&gt;\"><pre>git checkout <span class=\"pl-k\">&lt;</span>deleting_commit<span class=\"pl-k\">&gt;</span> -- <span class=\"pl-k\">&lt;</span>file_path<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-restore-file-to-a-specific-commit-hash\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#restore-file-to-a-specific-commit-hash\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Restore file to a specific commit-hash</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout &lt;commit-ish&gt; -- &lt;file_path&gt;\"><pre>git checkout <span class=\"pl-k\">&lt;</span>commit-ish<span class=\"pl-k\">&gt;</span> -- <span class=\"pl-k\">&lt;</span>file_path<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-always-rebase-instead-of-merge-on-pull\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#always-rebase-instead-of-merge-on-pull\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Always rebase instead of merge on pull.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global pull.rebase true\"><pre>git config --global pull.rebase <span class=\"pl-c1\">true</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"#git &lt; 1.7.9\ngit config --global branch.autosetuprebase always\"><pre><span class=\"pl-c\"><span class=\"pl-c\">#</span>git &lt; 1.7.9</span>\ngit config --global branch.autosetuprebase always</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-all-the-alias-and-configs\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-all-the-alias-and-configs\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List all the alias and configs.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --list\"><pre>git config --list</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-make-git-case-sensitive\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#make-git-case-sensitive\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Make git case sensitive.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global core.ignorecase false\"><pre>git config --global core.ignorecase <span class=\"pl-c1\">false</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-add-custom-editors\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#add-custom-editors\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Add custom editors.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global core.editor '$EDITOR'\"><pre>git config --global core.editor <span class=\"pl-s\"><span class=\"pl-pds\">'</span>$EDITOR<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-auto-correct-typos\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#auto-correct-typos\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Auto correct typos.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global help.autocorrect 1\"><pre>git config --global help.autocorrect 1</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-check-if-the-change-was-a-part-of-a-release\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#check-if-the-change-was-a-part-of-a-release\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Check if the change was a part of a release.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git name-rev --name-only &lt;SHA-1&gt;\"><pre>git name-rev --name-only <span class=\"pl-k\">&lt;</span>SHA-<span class=\"pl-k\">1&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-dry-run-any-command-that-supports-dry-run-flag-should-do\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#dry-run-any-command-that-supports-dry-run-flag-should-do\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Dry run. (any command that supports dry-run flag should do.)</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clean -fd --dry-run\"><pre>git clean -fd --dry-run</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-marks-your-commit-as-a-fix-of-a-previous-commit\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#marks-your-commit-as-a-fix-of-a-previous-commit\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Marks your commit as a fix of a previous commit.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git commit --fixup &lt;SHA-1&gt;\"><pre>git commit --fixup <span class=\"pl-k\">&lt;</span>SHA-<span class=\"pl-k\">1&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-squash-fixup-commits-normal-commits\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#squash-fixup-commits-normal-commits\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Squash fixup commits normal commits.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git rebase -i --autosquash\"><pre>git rebase -i --autosquash</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-skip-staging-area-during-commit\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#skip-staging-area-during-commit\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Skip staging area during commit.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git commit --only &lt;file_path&gt;\"><pre>git commit --only <span class=\"pl-k\">&lt;</span>file_path<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-interactive-staging\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#interactive-staging\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Interactive staging.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git add -i\"><pre>git add -i</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-ignored-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-ignored-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List ignored files.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git check-ignore *\"><pre>git check-ignore <span class=\"pl-k\">*</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-status-of-ignored-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#status-of-ignored-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Status of ignored files.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git status --ignored\"><pre>git status --ignored</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-commits-in-branch1-that-are-not-in-branch2\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#commits-in-branch1-that-are-not-in-branch2\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Commits in Branch1 that are not in Branch2</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log Branch1 ^Branch2\"><pre>git log Branch1 ^Branch2</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-n-last-commits\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-n-last-commits\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List n last commits</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log -&lt;n&gt;\"><pre>git log -<span class=\"pl-k\">&lt;</span>n<span class=\"pl-k\">&gt;</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log -n &lt;n&gt;\"><pre>git log -n <span class=\"pl-k\">&lt;</span>n<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Reuse recorded resolution, record and reuse previous conflicts resolutions.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global rerere.enabled 1\"><pre>git config --global rerere.enabled 1</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-open-all-conflicted-files-in-an-editor\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#open-all-conflicted-files-in-an-editor\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Open all conflicted files in an editor.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git diff --name-only | uniq | xargs $EDITOR\"><pre>git diff --name-only <span class=\"pl-k\">|</span> uniq <span class=\"pl-k\">|</span> xargs <span class=\"pl-smi\">$EDITOR</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-count-unpacked-number-of-objects-and-their-disk-consumption\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#count-unpacked-number-of-objects-and-their-disk-consumption\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Count unpacked number of objects and their disk consumption.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git count-objects --human-readable\"><pre>git count-objects --human-readable</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-prune-all-unreachable-objects-from-the-object-database\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#prune-all-unreachable-objects-from-the-object-database\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Prune all unreachable objects from the object database.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git gc --prune=now --aggressive\"><pre>git gc --prune=now --aggressive</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-instantly-browse-your-working-repository-in-gitweb\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#instantly-browse-your-working-repository-in-gitweb\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Instantly browse your working repository in gitweb.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git instaweb [--local] [--httpd=&lt;httpd&gt;] [--port=&lt;port&gt;] [--browser=&lt;browser&gt;]\"><pre>git instaweb [--local] [--httpd<span class=\"pl-k\">=&lt;</span>httpd<span class=\"pl-k\">&gt;</span>] [--port<span class=\"pl-k\">=&lt;</span>port<span class=\"pl-k\">&gt;</span>] [--browser<span class=\"pl-k\">=&lt;</span>browser<span class=\"pl-k\">&gt;</span>]</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-view-the-gpg-signatures-in-the-commit-log\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#view-the-gpg-signatures-in-the-commit-log\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>View the GPG signatures in the commit log</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --show-signature\"><pre>git log --show-signature</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-remove-entry-in-the-global-config\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#remove-entry-in-the-global-config\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Remove entry in the global config.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global --unset &lt;entry-name&gt;\"><pre>git config --global --unset <span class=\"pl-k\">&lt;</span>entry-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-checkout-a-new-branch-without-any-history\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#checkout-a-new-branch-without-any-history\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Checkout a new branch without any history</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout --orphan &lt;branch_name&gt;\"><pre>git checkout --orphan <span class=\"pl-k\">&lt;</span>branch_name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-extract-file-from-another-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#extract-file-from-another-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Extract file from another branch.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git show &lt;branch_name&gt;:&lt;file_name&gt;\"><pre>git show <span class=\"pl-k\">&lt;</span>branch_name<span class=\"pl-k\">&gt;</span>:<span class=\"pl-k\">&lt;</span>file_name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-only-the-root-and-merge-commits\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-only-the-root-and-merge-commits\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List only the root and merge commits.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --first-parent\"><pre>git log --first-parent</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-change-previous-two-commits-with-an-interactive-rebase\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#change-previous-two-commits-with-an-interactive-rebase\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Change previous two commits with an interactive rebase.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git rebase --interactive HEAD~2\"><pre>git rebase --interactive HEAD~2</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-all-branch-is-wip\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-all-branch-is-wip\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List all branch is WIP</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout master &amp;&amp; git branch --no-merged\"><pre>git checkout master <span class=\"pl-k\">&amp;&amp;</span> git branch --no-merged</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-find-guilty-with-binary-search\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#find-guilty-with-binary-search\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Find guilty with binary search</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git bisect start # Search start \ngit bisect bad # Set point to bad commit \ngit bisect good v2.6.13-rc2 # Set point to good commit|tag \ngit bisect bad # Say current state is bad \ngit bisect good # Say current state is good \ngit bisect reset # Finish search \n\"><pre>git bisect start <span class=\"pl-c\"><span class=\"pl-c\">#</span> Search start </span>\ngit bisect bad <span class=\"pl-c\"><span class=\"pl-c\">#</span> Set point to bad commit </span>\ngit bisect good v2.6.13-rc2 <span class=\"pl-c\"><span class=\"pl-c\">#</span> Set point to good commit|tag </span>\ngit bisect bad <span class=\"pl-c\"><span class=\"pl-c\">#</span> Say current state is bad </span>\ngit bisect good <span class=\"pl-c\"><span class=\"pl-c\">#</span> Say current state is good </span>\ngit bisect reset <span class=\"pl-c\"><span class=\"pl-c\">#</span> Finish search </span>\n</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-bypass-pre-commit-and-commit-msg-githooks\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#bypass-pre-commit-and-commit-msg-githooks\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Bypass pre-commit and commit-msg githooks</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git commit --no-verify\"><pre>git commit --no-verify</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-commits-and-changes-to-a-specific-file-even-through-renaming\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-commits-and-changes-to-a-specific-file-even-through-renaming\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List commits and changes to a specific file (even through renaming)</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --follow -p -- &lt;file_path&gt;\"><pre>git log --follow -p -- <span class=\"pl-k\">&lt;</span>file_path<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-clone-a-single-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#clone-a-single-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Clone a single branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clone -b &lt;branch-name&gt; --single-branch https://github.com/user/repo.git\"><pre>git clone -b <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span> --single-branch https://github.com/user/repo.git</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-create-and-switch-new-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#create-and-switch-new-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Create and switch new branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git checkout -b &lt;branch-name&gt;\"><pre>git checkout -b <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git branch &lt;branch-name&gt; &amp;&amp; git checkout &lt;branch-name&gt;\"><pre>git branch <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&amp;&amp;</span> git checkout <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git switch -c &lt;branch-name&gt;\"><pre>git switch -c <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-ignore-file-mode-changes-on-commits\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#ignore-file-mode-changes-on-commits\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Ignore file mode changes on commits</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config core.fileMode false\"><pre>git config core.fileMode <span class=\"pl-c1\">false</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-turn-off-git-colored-terminal-output\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#turn-off-git-colored-terminal-output\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Turn off git colored terminal output</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global color.ui false\"><pre>git config --global color.ui <span class=\"pl-c1\">false</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-specific-color-settings\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#specific-color-settings\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Specific color settings</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global &lt;specific command e.g branch, diff&gt; &lt;true, false or always&gt;\"><pre>git config --global <span class=\"pl-k\">&lt;</span>specific <span class=\"pl-c1\">command</span> e.g branch, diff<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&lt;</span>true, <span class=\"pl-c1\">false</span> or always<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-all-local-branches-ordered-by-recent-commits\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-all-local-branches-ordered-by-recent-commits\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show all local branches ordered by recent commits</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/\"><pre>git for-each-ref --sort=-committerdate --format=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>%(refname:short)<span class=\"pl-pds\">'</span></span> refs/heads/</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-find-lines-matching-the-pattern-regex-or-string-in-tracked-files\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#find-lines-matching-the-pattern-regex-or-string-in-tracked-files\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Find lines matching the pattern (regex or string) in tracked files</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git grep --heading --line-number 'foo bar'\"><pre>git grep --heading --line-number <span class=\"pl-s\"><span class=\"pl-pds\">'</span>foo bar<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-clone-a-shallow-copy-of-a-repository\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#clone-a-shallow-copy-of-a-repository\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Clone a shallow copy of a repository</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git clone https://github.com/user/repo.git --depth 1\"><pre>git clone https://github.com/user/repo.git --depth 1</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-search-commit-log-across-all-branches-for-given-text\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#search-commit-log-across-all-branches-for-given-text\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Search Commit log across all branches for given text</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --all --grep='&lt;given-text&gt;'\"><pre>git log --all --grep=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>&lt;given-text&gt;<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-get-first-commit-in-a-branch-from-master\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#get-first-commit-in-a-branch-from-master\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Get first commit in a branch (from master)</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --oneline master..&lt;branch-name&gt; | tail -1\"><pre>git log --oneline master..<span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">|</span> tail -1</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --reverse master..&lt;branch-name&gt; | head -6\"><pre>git log --reverse master..<span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">|</span> head -6</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-unstaging-staged-file\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#unstaging-staged-file\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Unstaging Staged file</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git reset HEAD &lt;file-name&gt;\"><pre>git reset HEAD <span class=\"pl-k\">&lt;</span>file-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-force-push-to-remote-repository\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#force-push-to-remote-repository\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Force push to Remote Repository</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git push -f &lt;remote-name&gt; &lt;branch-name&gt;\"><pre>git push -f <span class=\"pl-k\">&lt;</span>remote-name<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-adding-remote-name\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#adding-remote-name\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Adding Remote name</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git remote add &lt;remote-nickname&gt; &lt;remote-url&gt;\"><pre>git remote add <span class=\"pl-k\">&lt;</span>remote-nickname<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&lt;</span>remote-url<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-all-currently-configured-remotes\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-all-currently-configured-remotes\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List all currently configured remotes</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git remote -v\"><pre>git remote -v</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-the-author-time-and-last-revision-made-to-each-line-of-a-given-file\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show the author, time and last revision made to each line of a given file</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git blame &lt;file-name&gt;\"><pre>git blame <span class=\"pl-k\">&lt;</span>file-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-group-commits-by-authors-and-title\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#group-commits-by-authors-and-title\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Group commits by authors and title</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git shortlog\"><pre>git shortlog</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-forced-push-but-still-ensure-you-dont-overwrite-others-work\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#forced-push-but-still-ensure-you-dont-overwrite-others-work\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Forced push but still ensure you don't overwrite other's work</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git push --force-with-lease &lt;remote-name&gt; &lt;branch-name&gt;\"><pre>git push --force-with-lease <span class=\"pl-k\">&lt;</span>remote-name<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-how-many-lines-does-an-author-contribute\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-how-many-lines-does-an-author-contribute\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show how many lines does an author contribute</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += &lt;!-- @doxie.inject start --&gt;; subs += &lt;!-- @doxie.inject end --&gt;; loc += &lt;!-- @doxie.inject start --&gt; - &lt;!-- @doxie.inject end --&gt; } END { printf &quot;added lines: %s removed lines: %s total lines: %s\n&quot;, add, subs, loc }' -\"><pre>git log --author=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>_Your_Name_Here_<span class=\"pl-pds\">'</span></span> --pretty=tformat: --numstat <span class=\"pl-k\">|</span> gawk <span class=\"pl-s\"><span class=\"pl-pds\">'</span>{ add += &lt;!-- @doxie.inject start --&gt;; subs += &lt;!-- @doxie.inject end --&gt;; loc += &lt;!-- @doxie.inject start --&gt; - &lt;!-- @doxie.inject end --&gt; } END { printf \"added lines: %s removed lines: %s total lines: %s</span>\n<span class=\"pl-s\">\", add, subs, loc }<span class=\"pl-pds\">'</span></span> -</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += &lt;!-- @doxie.inject start --&gt;; subs += &lt;!-- @doxie.inject end --&gt;; loc += &lt;!-- @doxie.inject start --&gt; - &lt;!-- @doxie.inject end --&gt; } END { printf &quot;added lines: %s, removed lines: %s, total lines: %s\n&quot;, add, subs, loc }' - # on Mac OSX\"><pre>git log --author=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>_Your_Name_Here_<span class=\"pl-pds\">'</span></span> --pretty=tformat: --numstat <span class=\"pl-k\">|</span> awk <span class=\"pl-s\"><span class=\"pl-pds\">'</span>{ add += &lt;!-- @doxie.inject start --&gt;; subs += &lt;!-- @doxie.inject end --&gt;; loc += &lt;!-- @doxie.inject start --&gt; - &lt;!-- @doxie.inject end --&gt; } END { printf \"added lines: %s, removed lines: %s, total lines: %s</span>\n<span class=\"pl-s\">\", add, subs, loc }<span class=\"pl-pds\">'</span></span> - <span class=\"pl-c\"><span class=\"pl-c\">#</span> on Mac OSX</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-revert-reverting-an-entire-merge\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#revert-reverting-an-entire-merge\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Revert: Reverting an entire merge</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git revert -m 1 &lt;commit-ish&gt;\"><pre>git revert -m 1 <span class=\"pl-k\">&lt;</span>commit-ish<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-number-of-commits-in-a-branch\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#number-of-commits-in-a-branch\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Number of commits in a branch</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git rev-list --count &lt;branch-name&gt;\"><pre>git rev-list --count <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-alias-git-undo\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#alias-git-undo\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Alias: git undo</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'\"><pre>git config --global alias.undo <span class=\"pl-s\"><span class=\"pl-pds\">'</span>!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-add-object-notes\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#add-object-notes\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Add object notes</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git notes add -m 'Note on the previous commit....'\"><pre>git notes add -m <span class=\"pl-s\"><span class=\"pl-pds\">'</span>Note on the previous commit....<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-all-the-git-notes\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-all-the-git-notes\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show all the git-notes</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --show-notes='*'\"><pre>git log --show-notes=<span class=\"pl-s\"><span class=\"pl-pds\">'</span>*<span class=\"pl-pds\">'</span></span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-apply-commit-from-another-repository\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#apply-commit-from-another-repository\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Apply commit from another repository</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git --git-dir=&lt;source-dir&gt;/.git format-patch -k -1 --stdout &lt;SHA1&gt; | git am -3 -k\"><pre>git --git-dir=<span class=\"pl-k\">&lt;</span>source-dir<span class=\"pl-k\">&gt;</span>/.git format-patch -k -1 --stdout <span class=\"pl-k\">&lt;</span>SHA<span class=\"pl-k\">1&gt;</span> <span class=\"pl-k\">|</span> git am -3 -k</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-specific-fetch-reference\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#specific-fetch-reference\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Specific fetch reference</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git fetch origin master:refs/remotes/origin/mymaster\"><pre>git fetch origin master:refs/remotes/origin/mymaster</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-find-common-ancestor-of-two-branches\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#find-common-ancestor-of-two-branches\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Find common ancestor of two branches</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git merge-base &lt;branch-name&gt; &lt;other-branch-name&gt;\"><pre>git merge-base <span class=\"pl-k\">&lt;</span>branch-name<span class=\"pl-k\">&gt;</span> <span class=\"pl-k\">&lt;</span>other-branch-name<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-list-unpushed-git-commits\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#list-unpushed-git-commits\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>List unpushed git commits</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log --branches --not --remotes\"><pre>git log --branches --not --remotes</pre></div>\n<p dir=\"auto\"><strong>Alternatives:</strong></p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git log @{u}..\"><pre>git log @{u}..</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git cherry -v\"><pre>git cherry -v</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-add-everything-but-whitespace-changes\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#add-everything-but-whitespace-changes\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Add everything, but whitespace changes</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git diff --ignore-all-space | git apply --cached\"><pre>git diff --ignore-all-space <span class=\"pl-k\">|</span> git apply --cached</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-edit-localglobal-git-config\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#edit-localglobal-git-config\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Edit [local/global] git config</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git config [--global] --edit\"><pre>git config [--global] --edit</pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-blame-on-certain-range\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#blame-on-certain-range\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>blame on certain range</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git blame -L &lt;start&gt;,&lt;end&gt;\"><pre>git blame -L <span class=\"pl-k\">&lt;</span>start<span class=\"pl-k\">&gt;</span>,<span class=\"pl-k\">&lt;</span>end<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-show-a-git-logical-variable\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#show-a-git-logical-variable\"><svg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"></path></svg></a>Show a Git logical variable.</h2>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"git var -l | &lt;variable&gt;\"><pre>git var -l <span class=\"pl-k\">|</span> <span class=\"pl-k\">&lt;</span>variable<span class=\"pl-k\">&gt;</span></pre></div>\n<h2 tabindex=\"-1\" dir=\"auto\"><a id=\"user-content-preformatted-patch-file\" class=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" href=\"#preformatted-patch-file\&q