{"id":19956606,"url":"https://github.com/abhinavkorpal/git","last_synced_at":"2026-05-10T02:01:33.302Z","repository":{"id":130431083,"uuid":"155767217","full_name":"abhinavkorpal/git","owner":"abhinavkorpal","description":"Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.","archived":false,"fork":false,"pushed_at":"2020-05-19T17:45:31.000Z","size":224,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-12T07:10:18.145Z","etag":null,"topics":["git","github","github-pages"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abhinavkorpal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-01T19:44:49.000Z","updated_at":"2020-07-27T02:45:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"6470d4c3-0b04-47b5-b237-9d117c071b82","html_url":"https://github.com/abhinavkorpal/git","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavkorpal%2Fgit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavkorpal%2Fgit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavkorpal%2Fgit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abhinavkorpal%2Fgit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abhinavkorpal","download_url":"https://codeload.github.com/abhinavkorpal/git/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241389110,"owners_count":19955106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","github","github-pages"],"created_at":"2024-11-13T01:34:58.047Z","updated_at":"2026-05-10T02:01:33.009Z","avatar_url":"https://github.com/abhinavkorpal.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eDeveloper's Git ✨\u003c/h1\u003e\n\u003c/p\u003e\n\n\n\nGit Help\n===============\nSometimes you just need a little help.\n\n- [Git Help](#git-help)\n    - [Github Git Cheat Sheet](#github-git-cheat-sheet)\n        * [CONFIGURE TOOLING](#configure-tooling)\n        * [CREATE REPOSITORIES](#create-repositories)\n        * [MAKE CHANGES](#make-changes)\n        * [GROUP CHANGES](#group-changes)\n        * [Review history](#review-history)\n        * [Suppress tracking](#suppress-tracking)\n        * [Redo commits](#redo-commits)\n        * [Save fragments](#save-fragments)\n        * [Synchronize changes](#synchronize-changes)\n        * [create a new repository on the command line](#create-a-new-repository-on-the-command-line)\n        * [push an existing repository from the command line](#push-an-existing-repository-from-the-command-line)\n    - [Git and Git Flow Cheat Sheet](#git-and-git-flow-cheat-sheet)\n        * [Set Up](#setup)\n        * [Configuration Files](#configuration-files)\n        * [Create](#create)\n        * [Local Changes](#local-changes)\n        * [Search](#search)\n        * [Commit History](#commit-history)\n        * [Branches \u0026 Tags](#branches--tags)\n        * [Update \u0026 Publish](#update--publish)\n        * [Merge \u0026 Rebase](#merge--rebase)\n        * [Undo](#undo)\n        * [Git Flow](#git-flow)\n    - [Git Tips](#git-tips)\n        * [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so)\n        * [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git)\n        * [Search change by content](#search-change-by-content)\n        * [Remove sensitive data from history, after a push](#remove-sensitive-data-from-history-after-a-push)\n        * [Sync with remote, overwrite local changes](#sync-with-remote-overwrite-local-changes)\n        * [List of all files till a commit](#list-of-all-files-till-a-commit)\n        * [Git reset first commit](#git-reset-first-commit)\n        * [List all the conflicted files](#list-all-the-conflicted-files)\n        * [List of all files changed in a commit](#list-of-all-files-changed-in-a-commit)\n        * [Unstaged changes since last commit](#unstaged-changes-since-last-commit)\n        * [Changes staged for commit](#changes-staged-for-commit)\n        * [Show both staged and unstaged changes](#show-both-staged-and-unstaged-changes)\n        * [List all branches that are already merged into master](#list-all-branches-that-are-already-merged-into-master)\n        * [Quickly switch to the previous branch](#quickly-switch-to-the-previous-branch)\n        * [Remove branches that have already been merged with master](#remove-branches-that-have-already-been-merged-with-master)\n        * [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)\n        * [Track upstream branch](#track-upstream-branch)\n        * [Delete local branch](#delete-local-branch)\n        * [Delete remote branch](#delete-remote-branch)\n        * [Delete local tag](#delete-local-tag)\n        * [Delete remote tag](#delete-remote-tag)\n        * [Undo local changes with the last content in head](#undo-local-changes-with-the-last-content-in-head)\n        * [Revert: Undo a commit by creating a new commit](#revert-undo-a-commit-by-creating-a-new-commit)\n        * [Reset: Discard commits, advised for private branch](#reset-discard-commits-advised-for-private-branch)\n        * [Reword the previous commit message](#reword-the-previous-commit-message)\n        * [See commit history for just the current branch](#see-commit-history-for-just-the-current-branch)\n        * [Amend author.](#amend-author)\n        * [Reset author, after author has been changed in the global config.](#reset-author-after-author-has-been-changed-in-the-global-config)\n        * [Changing a remote's URL](#changing-a-remotes-url)\n        * [Get list of all remote references](#get-list-of-all-remote-references)\n        * [Get list of all local and remote branches](#get-list-of-all-local-and-remote-branches)\n        * [Get only remote branches](#get-only-remote-branches)\n        * [Stage parts of a changed file, instead of the entire file](#stage-parts-of-a-changed-file-instead-of-the-entire-file)\n        * [Get git bash completion](#get-git-bash-completion)\n        * [What changed since two weeks?](#what-changed-since-two-weeks)\n        * [See all commits made since forking from master](#see-all-commits-made-since-forking-from-master)\n        * [Pick commits across branches using cherry-pick](#pick-commits-across-branches-using-cherry-pick)\n        * [Find out branches containing commit-hash](#find-out-branches-containing-commit-hash)\n        * [Git Aliases](#git-aliases)\n        * [Saving current state of tracked files without commiting](#saving-current-state-of-tracked-files-without-commiting)\n        * [Saving current state of unstaged changes to tracked files](#saving-current-state-of-unstaged-changes-to-tracked-files)\n        * [Saving current state including untracked files](#saving-current-state-including-untracked-files)\n        * [Saving current state with message](#saving-current-state-with-message)\n        * [Saving current state of all files (ignored, untracked, and tracked)](#saving-current-state-of-all-files-ignored-untracked-and-tracked)\n        * [Show list of all saved stashes](#show-list-of-all-saved-stashes)\n        * [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list)\n        * [Apply last stashed state and delete it from stashed list](#apply-last-stashed-state-and-delete-it-from-stashed-list)\n        * [Delete all stored stashes](#delete-all-stored-stashes)\n        * [Grab a single file from a stash](#grab-a-single-file-from-a-stash)\n        * [Show all tracked files](#show-all-tracked-files)\n        * [Show all untracked files](#show-all-untracked-files)\n        * [Show all ignored files](#show-all-ignored-files)\n        * [Create new working tree from a repository (git 2.5)](#create-new-working-tree-from-a-repository-git-25)\n        * [Create new working tree from HEAD state](#create-new-working-tree-from-head-state)\n        * [Untrack files without deleting](#untrack-files-without-deleting)\n        * [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories)\n        * [Forcefully remove untracked files](#forcefully-remove-untracked-files)\n        * [Forcefully remove untracked directory](#forcefully-remove-untracked-directory)\n        * [Update all the submodules](#update-all-the-submodules)\n        * [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)\n        * [Rename a branch](#rename-a-branch)\n        * [Rebases 'feature' to 'master' and merges it in to master ](#rebases-feature-to-master-and-merges-it-in-to-master)\n        * [Archive the `master` branch](#archive-the-master-branch)\n        * [Modify previous commit without modifying the commit message](#modify-previous-commit-without-modifying-the-commit-message)\n        * [Prunes references to remote branches that have been deleted in the remote.](#prunes-references-to-remote-branches-that-have-been-deleted-in-the-remote)\n        * [Retrieve the commit hash of the initial revision.](#retrieve-the-commit-hash-of-the-initial-revision)\n        * [Visualize the version tree.](#visualize-the-version-tree)\n        * [Visualize the tree including commits that are only referenced from reflogs](#visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs)\n        * [Deploying git tracked subfolder to gh-pages](#deploying-git-tracked-subfolder-to-gh-pages)\n        * [Adding a project to repo using subtree](#adding-a-project-to-repo-using-subtree)\n        * [Get latest changes in your repo for a linked project using subtree](#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree)\n        * [Export a branch with history to a file.](#export-a-branch-with-history-to-a-file)\n        * [Import from a bundle](#import-from-a-bundle)\n        * [Get the name of current branch.](#get-the-name-of-current-branch)\n        * [Ignore one file on commit (e.g. Changelog).](#ignore-one-file-on-commit-eg-changelog)\n        * [Stash changes before rebasing](#stash-changes-before-rebasing)\n        * [Fetch pull request by ID to a local branch](#fetch-pull-request-by-id-to-a-local-branch)\n        * [Show the most recent tag on the current branch.](#show-the-most-recent-tag-on-the-current-branch)\n        * [Show inline word diff.](#show-inline-word-diff)\n        * [Show changes using common diff tools.](#show-changes-using-common-diff-tools)\n        * [Don’t consider changes for tracked file.](#dont-consider-changes-for-tracked-file)\n        * [Undo assume-unchanged.](#undo-assume-unchanged)\n        * [Clean the files from `.gitignore`.](#clean-the-files-from-gitignore)\n        * [Restore deleted file.](#restore-deleted-file)\n        * [Restore file to a specific commit-hash](#restore-file-to-a-specific-commit-hash)\n        * [Always rebase instead of merge on pull.](#always-rebase-instead-of-merge-on-pull)\n        * [List all the alias and configs.](#list-all-the-alias-and-configs)\n        * [Make git case sensitive.](#make-git-case-sensitive)\n        * [Add custom editors.](#add-custom-editors)\n        * [Auto correct typos.](#auto-correct-typos)\n        * [Check if the change was a part of a release.](#check-if-the-change-was-a-part-of-a-release)\n        * [Dry run. (any command that supports dry-run flag should do.)](#dry-run-any-command-that-supports-dry-run-flag-should-do)\n        * [Marks your commit as a fix of a previous commit.](#marks-your-commit-as-a-fix-of-a-previous-commit)\n        * [Squash fixup commits normal commits.](#squash-fixup-commits-normal-commits)\n        * [Skip staging area during commit.](#skip-staging-area-during-commit)\n        * [Interactive staging.](#interactive-staging)\n        * [List ignored files.](#list-ignored-files)\n        * [Status of ignored files.](#status-of-ignored-files)\n        * [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2)\n        * [List n last commits](#list-n-last-commits)\n        * [Reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions)\n        * [Open all conflicted files in an editor.](#open-all-conflicted-files-in-an-editor)\n        * [Count unpacked number of objects and their disk consumption.](#count-unpacked-number-of-objects-and-their-disk-consumption)\n        * [Prune all unreachable objects from the object database.](#prune-all-unreachable-objects-from-the-object-database)\n        * [Instantly browse your working repository in gitweb.](#instantly-browse-your-working-repository-in-gitweb)\n        * [View the GPG signatures in the commit log](#view-the-gpg-signatures-in-the-commit-log)\n        * [Remove entry in the global config.](#remove-entry-in-the-global-config)\n        * [Checkout a new branch without any history](#checkout-a-new-branch-without-any-history)\n        * [Extract file from another branch.](#extract-file-from-another-branch)\n        * [List only the root and merge commits.](#list-only-the-root-and-merge-commits)\n        * [Change previous two commits with an interactive rebase.](#change-previous-two-commits-with-an-interactive-rebase)\n        * [List all branch is WIP](#list-all-branch-is-wip)\n        * [Find guilty with binary search](#find-guilty-with-binary-search)\n        * [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks)\n        * [List commits and changes to a specific file (even through renaming)](#list-commits-and-changes-to-a-specific-file-even-through-renaming)\n        * [Clone a single branch](#clone-a-single-branch)\n        * [Create and switch new branch](#create-and-switch-new-branch)\n        * [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits)\n        * [Turn off git colored terminal output](#turn-off-git-colored-terminal-output)\n        * [Specific color settings](#specific-color-settings)\n        * [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits)\n        * [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files)\n        * [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository)\n        * [Search Commit log across all branches for given text](#search-commit-log-across-all-branches-for-given-text)\n        * [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master)\n        * [Unstaging Staged file](#unstaging-staged-file)\n        * [Force push to Remote Repository](#force-push-to-remote-repository)\n        * [Adding Remote name](#adding-remote-name)\n        * [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)\n        * [Group commits by authors and title](#group-commits-by-authors-and-title)\n        * [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work)\n        * [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute)\n        * [Revert: Reverting an entire merge](#revert-reverting-an-entire-merge)\n        * [Number of commits in a branch](#number-of-commits-in-a-branch)\n        * [Alias: git undo](#alias-git-undo)\n        * [Add object notes](#add-object-notes)\n        * [Show all the git-notes](#show-all-the-git-notes)\n        * [Apply commit from another repository](#apply-commit-from-another-repository)\n        * [Specific fetch reference](#specific-fetch-reference)\n        * [Find common ancestor of two branches](#find-common-ancestor-of-two-branches)\n        * [List unpushed git commits](#list-unpushed-git-commits)\n        * [Add everything, but whitespace changes](#add-everything-but-whitespace-changes)\n        * [Edit [local/global] git config](#edit-localglobal-git-config)\n        * [blame on certain range](#blame-on-certain-range)\n        * [Show a Git logical variable.](#show-a-git-logical-variable)\n        * [Preformatted patch file.](#preformatted-patch-file)\n        * [Get the repo name.](#get-the-repo-name)\n        * [logs between date range](#logs-between-date-range)\n        * [Exclude author from logs](#exclude-author-from-logs)\n        * [Generates a summary of pending changes](#generates-a-summary-of-pending-changes)\n        * [List references in a remote repository](#list-references-in-a-remote-repository)\n        * [Backup untracked files.](#backup-untracked-files)\n        * [List all git aliases](#list-all-git-aliases)\n        * [Show git status short](#show-git-status-short)\n        * [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago)\n        * [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track)\n        * [Change a branch base](#change-a-branch-base)\n        * [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes)\n\nGithub Git Cheat Sheet\n===============\n\n##### CONFIGURE TOOLING\nConfigure user information for all local repositories\n\n```shell\n$ git config --global user.name \"[name]\"\nSets the name you want atached to your commit transactions\n```\n\n```shell\n$ git config --global user.email \"[email address]\"\nSets the email you want atached to your commit transactions\n```\n\n```shell\n$ git config --global color.ui auto\nEnables helpful colorization of command line output\n```\n\n##### CREATE REPOSITORIES\nStart a new repository or obtain one from an existing URL\n\n```shell\n$ git init [project-name]\nCreates a new local repository with the specified name\n```\n\n```shell\n$ git clone [url]\nDownloads a project and its entire version history\n```\n\n##### MAKE CHANGES\nReview edits and craft a commit transaction\n\n```shell\n$ git status\nLists all new or modified files to be commited\n```\n\n```shell\n$ git diff\nShows file differences not yet staged\n```\n\n```shell\n$ git add [file]\nSnapshots the file in preparation for versioning\n```\n\n```shell\n$ git diff --staged\nShows file differences between staging and the last file version\n```\n\n```shell\n$ git reset [file]\nUnstages the file, but preserve its contents\n```\n\n```shell\n$ git commit -m \"[descriptive message]\"\nRecords file snapshots permanently in version history\n```\n\n##### GROUP CHANGES\nName a series of commits and combine completed efforts\n\n```shell\n$ git branch\nLists all local branches in the current repository\n```\n\n```shell\n$ git branch [branch-name]\nCreates a new branch\n```\n\n```shell\n$ git checkout [branch-name]\nSwitches to the specified branch and updates the working directory\n```\n\n```shell\n$ git merge [branch]\nCombines the specified branch’s history into the current branch\n```\n\n```shell\n$ git branch -d [branch-name]\nDeletes the specified branch\n```\n\n##### Refactor file names\nRelocate and remove versioned files\n```shell\n$ git rm [file]\n\nDeletes the file from the working directory and stages the deletion\n\n$ git rm --cached [file]\n\nRemoves the file from version control but preserves the file locally\n\n$ git mv [file-original] [file-renamed]\n\nChanges the file name and prepare it for commit\n```\n\n##### Review history\nBrowse and inspect the evolution of project files\n```shell\n$ git log\n\nLists version history for the current branch\n\n$ git log --follow [file]\n\nLists version history for the file, including renames\n\n$ git diff [first-branch]...[second-branch]\n\nShows content differences between two branches\n\n$ git show [commit]\n\nOutputs metadata and content changes of the specified commit\n```\n\n##### Suppress tracking\nExclude temporary files and paths\n```shell\n*.log\nbuild/\ntemp-*\nA text file named .gitignore suppresses accidental versioning of files and paths matching the specified patterns\n\n$ git ls-files --others --ignored --exclude-standard\n\nLists all ignored files in this project\n```\n\n##### Redo commits\nErase mistakes and craft replacement history\n```shell\n$ git reset [commit]\n\nUndoes all commits after [commit], preserving changes locally\n\n$ git reset --hard [commit]\n\nDiscards all history and changes back to the specified commit\n```\n\n##### Save fragments\nShelve and restore incomplete changes\n```shell\n$ git stash\n\nTemporarily stores all modified tracked files\n\n$ git stash pop\n\nRestores the most recently stashed files\n\n$ git stash list\n\nLists all stashed changesets\n\n$ git stash drop\n\nDiscards the most recently stashed changeset\n```\n\n##### Synchronize changes\nRegister a remote (URL) and exchange repository history\n```shell\n$ git fetch [remote]\n\nDownloads all history from the remote repository\n\n$ git merge [remote]/[branch]\n\nCombines the remote branch into the current local branch\n\n$ git push [remote] [branch]\n\nUploads all local branch commits to GitHub\n\n$ git pull\n\nDownloads bookmark history and incorporates changes\n```\n\n##### create a new repository on the command line\n\n```shell\necho \"# GitHub-Help\" \u003e\u003e README.md\ngit init\ngit add README.md\ngit commit -m \"first commit\"\ngit remote add origin https://github.com/abhinavkorpal/GitHub-Help.git\ngit push -u origin master\n```\n\n##### push an existing repository from the command line\n\n```shell\ngit remote add origin https://github.com/abhinavkorpal/GitHub-Help.git\ngit push -u origin master\n```\n\n##### Issues\n\nFixing the “GH001: Large files detected. You may want to try Git Large File Storage.”\n```shell\nremote: error: GH001: Large files detected. You may want to try Git Large File Storage — https://git-lfs.github.com.\nremote: error: Trace: b5116d865251981c96d4b32cdf7ef464\nremote: error: See http://git.io/iEPt8g for more information.\nremote: error: File fixtures/11_user_answer.json is 131.37 MB; this exceeds GitHub’s file size limit of 100.00 MB\n```\nIt turned out that GitHub only allows for 100 MB file. The problem is that I can’t simply remove the file because it is tracked inside the previous commits so I have to remove this file completely from my repo.\n\nThe command that allow you to do it is:\n```shell\ngit filter-branch -f --index-filter 'git rm --cached --ignore-unmatch fixtures/11_user_answer.json'\n```\nAt which point you can push the file to GitHub.\n\nGit and Git Flow Cheat Sheet\n===============\n\u003chr\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Git\" src=\"./images/git-logo.png\" height=\"190\" width=\"455\"\u003e\n\u003c/p\u003e\n\u003chr\u003e\n\nGit Cheat Sheet\n===============\n### Index\n* [Set Up](#setup)\n* [Configuration Files](#configuration-files)\n* [Create](#create)\n* [Local Changes](#local-changes)\n* [Search](#search)\n* [Commit History](#commit-history)\n* [Branches \u0026 Tags](#branches--tags)\n* [Update \u0026 Publish](#update--publish)\n* [Merge \u0026 Rebase](#merge--rebase)\n* [Undo](#undo)\n* [Git Flow](#git-flow)\n\n\n\u003chr\u003e\n\n## Setup\n\n##### Show current configuration:\n```\n$ git config --list\n```\n##### Show repository configuration:\n```\n$ git config --local --list\n```\n\n##### Show global configuration:\n```\n$ git config --global --list\n```\n\n##### Show system configuration:\n```\n$ git config --system --list\n```\n\n##### Set a name that is identifiable for credit when review version history:\n```\n$ git config --global user.name “[firstname lastname]”\n```\n\n##### Set an email address that will be associated with each history marker:\n```\n$ git config --global user.email “[valid-email]”\n```\n\n##### Set automatic command line coloring for Git for easy reviewing:\n```\n$ git config --global color.ui auto\n```\n\n##### Set global editor for commit\n```\n$ git config --global core.editor vi\n```\n\n\u003chr\u003e\n\n## Configuration Files\n\n##### Repository specific configuration file [--local]:\n```\n\u003crepo\u003e/.git/config\n```\n\n##### User-specific configuration file [--global]:\n```\n~/.gitconfig\n```\n\n##### System-wide configuration file [--system]:\n```\n/etc/gitconfig\n```\n\n\u003chr\u003e\n\n## Create\n\n##### Clone an existing repository:\n\nThere are two ways:\n\nVia SSH\n\n```\n$ git clone ssh://user@domain.com/repo.git\n```\n\nVia HTTP\n\n```\n$ git clone http://domain.com/user/repo.git\n```\n\n##### Create a new local repository in the current directory:\n```\n$ git init\n```\n\n##### Create a new local repository in a specific directory:\n```\n$ git init \u003cdirectory\u003e\n```\n\n\u003chr\u003e\n\n## Local Changes\n\n##### Changes in working directory:\n```\n$ git status\n```\n\n##### Changes to tracked files:\n```\n$ git diff\n```\n\n##### See changes/difference of a specific file:\n```\n$ git diff \u003cfile\u003e\n```\n\n##### Add all current changes to the next commit:\n```\n$ git add .\n```\n\n##### Add some changes in \u0026lt;file\u0026gt; to the next commit:\n```\n$ git add -p \u003cfile\u003e\n```\n\n##### Commit all local changes in tracked files:\n```\n$ git commit -a\n```\n\n##### Commit previously staged changes:\n```\n$ git commit\n```\n\n##### Commit with message:\n```\n$ git commit -m 'message here'\n```\n\n##### Commit skipping the staging area and adding message:\n```\n$ git commit -am 'message here'\n```\n\n##### Commit to some previous date:\n```\n$ git commit --date=\"`date --date='n day ago'`\" -am \"\u003cCommit Message Here\u003e\"\n```\n\n##### Change last commit:\u003cbr\u003e\n\u003cem\u003e\u003csub\u003eDon't amend published commits!\u003c/sub\u003e\u003c/em\u003e\n\n```\n$ git commit -a --amend\n```\n\n##### Amend with last commit but use the previous commit log message\n\u003cem\u003e\u003csub\u003eDon't amend published commits!\u003c/sub\u003e\u003c/em\u003e\n\n```shell\n$ git commit --amend --no-edit\n```\n\n##### Change committer date of last commit:\n```\nGIT_COMMITTER_DATE=\"date\" git commit --amend\n```\n\n##### Change Author date of last commit:\n```shell\n$ git commit --amend --date=\"date\"\n```\n\n##### Move uncommitted changes from current branch to some other branch:\u003cbr\u003e\n```\n$ git stash\n$ git checkout branch2\n$ git stash pop\n```\n\n##### Restore stashed changes back to current branch:\n```shell\n$ git stash apply\n```\n\n#### Restore particular stash back to current branch:\n- *{stash_number}* can be obtained from `git stash list`\n\n```shell\n$ git stash apply stash@{stash_number}\n```\n\n##### Remove the last set of stashed changes:\n```\n$ git stash drop\n```\n\n\u003chr\u003e\n\n## Search\n\n##### A text search on all files in the directory:\n```\n$ git grep \"Hello\"\n```\n\n##### In any version of a text search:\n```\n$ git grep \"Hello\" v2.5\n```\n\n\u003chr\u003e\n\n## Commit History\n\n##### Show all commits, starting with newest (it'll show the hash, author information, date of commit and title of the commit):\n```\n$ git log\n```\n\n##### Show all the commits(it'll show just the commit hash and the commit message):\n```\n$ git log --oneline\n```\n\n##### Show all commits of a specific user:\n```\n$ git log --author=\"username\"\n```\n\n##### Show changes over time for a specific file:\n```\n$ git log -p \u003cfile\u003e\n```\n\n##### Display commits that are present only in remote/branch in right side\n```\n$ git log --oneline \u003corigin/master\u003e..\u003cremote/master\u003e --left-right\n```\n\n##### Who changed, what and when in \u0026lt;file\u0026gt;:\n```\n$ git blame \u003cfile\u003e\n```\n\n##### Show Reference log:\n```\n$ git reflog show\n```\n\n##### Delete Reference log:\n```\n$ git reflog delete\n```\n\u003chr\u003e\n\n## Move / Rename\n\n##### Rename a file:\n\nRename Index.txt to Index.html\n\n```\n$ git mv Index.txt Index.html\n```\n\n\u003chr\u003e\n\n## Branches \u0026 Tags\n\n##### List all local branches:\n```\n$ git branch\n```\n\n#### List local/remote branches\n```\n$ git branch -a\n```\n\n##### List all remote branches:\n```\n$ git branch -r\n```\n\n##### Switch HEAD branch:\n```\n$ git checkout \u003cbranch\u003e\n```\n\n##### Checkout single file from different branch\n```\n$ git checkout \u003cbranch\u003e -- \u003cfilename\u003e\n```\n\n##### Create and switch new branch:\n```\n$ git checkout -b \u003cbranch\u003e\n```\n\n\n##### Create a new branch from an exiting branch and switch to new branch:\n```\n$ git checkout -b \u003cnew_branch\u003e \u003cexisting_branch\u003e\n```\n\n\n#### Checkout and create a new branch from existing commit\n```\n$ git checkout \u003ccommit-hash\u003e -b \u003cnew_branch_name\u003e\n```\n\n\n##### Create a new branch based on your current HEAD:\n```\n$ git branch \u003cnew-branch\u003e\n```\n\n##### Create a new tracking branch based on a remote branch:\n```\n$ git branch --track \u003cnew-branch\u003e \u003cremote-branch\u003e\n```\n\n##### Delete a local branch:\n```\n$ git branch -d \u003cbranch\u003e\n```\n\n##### Rename current branch to new branch name\n```shell\n$ git branch -m \u003cnew_branch_name\u003e\n```\n\n##### Force delete a local branch:\n\u003cem\u003e\u003csub\u003eYou will lose unmerged changes!\u003c/sub\u003e\u003c/em\u003e\n\n```\n$ git branch -D \u003cbranch\u003e\n```\n\n##### Mark the current commit with a tag:\n```\n$ git tag \u003ctag-name\u003e\n```\n\n##### Mark the current commit with a tag that includes a message:\n```\n$ git tag -a \u003ctag-name\u003e\n```\n\u003chr\u003e\n\n## Update \u0026 Publish\n\n##### List all current configured remotes:\n```\n$ git remote -v\n```\n\n##### Show information about a remote:\n```\n$ git remote show \u003cremote\u003e\n```\n\n##### Add new remote repository, named \u0026lt;remote\u0026gt;:\n```\n$ git remote add \u003cremote\u003e \u003curl\u003e\n```\n\n##### Download all changes from \u0026lt;remote\u0026gt;, but don't integrate into HEAD:\n```\n$ git fetch \u003cremote\u003e\n```\n\n##### Download changes and directly merge/integrate into HEAD:\n```\n$ git remote pull \u003cremote\u003e \u003curl\u003e\n```\n\n##### Get all changes from HEAD to local repository:\n```\n$ git pull origin master\n```\n\n##### Get all changes from HEAD to local repository without a merge:\n```\n$ git pull --rebase \u003cremote\u003e \u003cbranch\u003e\n```\n\n##### Publish local changes on a remote:\n```\n$ git push remote \u003cremote\u003e \u003cbranch\u003e\n```\n\n##### Delete a branch on the remote:\n```\n$ git push \u003cremote\u003e :\u003cbranch\u003e (since Git v1.5.0)\n```\nOR\n```\n$ git push \u003cremote\u003e --delete \u003cbranch\u003e (since Git v1.7.0)\n```\n\n##### Publish your tags:\n```\n$ git push --tags\n```\n\u003chr\u003e\n\n#### Configure the merge tool globally to meld (editor)\n```bash\n$ git config --global merge.tool meld\n```\n\n##### Use your configured merge tool to solve conflicts:\n```\n$ git mergetool\n```\n\n## Merge \u0026 Rebase\n\n##### Merge branch into your current HEAD:\n```\n$ git merge \u003cbranch\u003e\n```\n\n##### Rebase your current HEAD onto \u0026lt;branch\u0026gt;:\u003cbr\u003e\n\u003cem\u003e\u003csub\u003eDon't rebase published commit!\u003c/sub\u003e\u003c/em\u003e\n\n```\n$ git rebase \u003cbranch\u003e\n```\n\n##### Abort a rebase:\n```\n$ git rebase --abort\n```\n\n##### Continue a rebase after resolving conflicts:\n```\n$ git rebase --continue\n```\n\n##### Use your editor to manually solve conflicts and (after resolving) mark file as resolved:\n```\n$ git add \u003cresolved-file\u003e\n```\n\n```\n$ git rm \u003cresolved-file\u003e\n```\n\n##### Squashing commits:\n```\n$ git rebase -i \u003ccommit-just-before-first\u003e\n```\n\nNow replace this,\n\n```\npick \u003ccommit_id\u003e\npick \u003ccommit_id2\u003e\npick \u003ccommit_id3\u003e\n```\n\nto this,\n\n```\npick \u003ccommit_id\u003e\nsquash \u003ccommit_id2\u003e\nsquash \u003ccommit_id3\u003e\n```\n\u003chr\u003e\n\n## Undo\n\n##### Discard all local changes in your working directory:\n```\n$ git reset --hard HEAD\n```\n\n##### Get all the files out of the staging area(i.e. undo the last `git add`):\n```\n$ git reset HEAD\n```\n\n##### Discard local changes in a specific file:\n```\n$ git checkout HEAD \u003cfile\u003e\n```\n\n##### Revert a commit (by producing a new commit with contrary changes):\n```\n$ git revert \u003ccommit\u003e\n```\n\n##### Reset your HEAD pointer to a previous commit and discard all changes since then:\n```\n$ git reset --hard \u003ccommit\u003e\n```\n\n##### Reset your HEAD pointer to a remote branch current state.\n```\n$ git reset --hard \u003cremote/branch\u003e e.g., upstream/master, origin/my-feature\n```\n\n##### Reset your HEAD pointer to a previous commit and preserve all changes as unstaged changes:\n```\n$ git reset \u003ccommit\u003e\n```\n\n##### Reset your HEAD pointer to a previous commit and preserve uncommitted local changes:\n```\n$ git reset --keep \u003ccommit\u003e\n```\n\n##### Remove files that were accidentally committed before they were added to .gitignore\n```\n$ git rm -r --cached .\n$ git add .\n$ git commit -m \"remove xyz file\"\n```\n\u003chr\u003e\n\n## Git-Flow\nImproved [Git-flow](https://github.com/petervanderdoes/gitflow-avh)\n\n### Index\n* [Setup](#setup)\n* [Getting Started](#getting-started)\n* [Features](#features)\n* [Make a Release](#make-a-release)\n* [Hotfixes](#hotfixes)\n* [Commands](#commands)\n\n\u003chr\u003e\n\n### Setup\n###### You need a working git installation as prerequisite. Git flow works on OSX, Linux and Windows.\n\n##### OSX Homebrew:\n```\n$ brew install git-flow-avh\n```\n\n##### OSX Macports:\n```\n$ port install git-flow\n```\n\n##### Linux (Debian-based):\n```\n$ sudo apt-get install git-flow\n```\n\n##### Windows (Cygwin):\n###### You need wget and util-linux to install git-flow.\n```bash\n$ wget -q -O - --no-check-certificate https://raw.githubusercontent.com/petervanderdoes/gitflow/develop/contrib/gitflow-installer.sh install \u003cstate\u003e | bash\n```\n\u003chr\u003e\n\n### Getting Started\n###### Git flow needs to be initialized in order to customize your project setup. Start using git-flow by initializing it inside an existing git repository:\n##### Initialize:\n###### You'll have to answer a few questions regarding the naming conventions for your branches. It's recommended to use the default values.\n```shell\ngit flow init\n```\nOR\n###### To use default\n```shell\ngit flow init -d\n```\n\u003chr\u003e\n\n### Features\n###### Develop new features for upcoming releases. Typically exist in developers repos only.\n##### Start a new feature:\n###### This action creates a new feature branch based on 'develop' and switches to it.\n```\ngit flow feature start MYFEATURE\n```\n\n##### Finish up a feature:\n###### Finish the development of a feature. This action performs the following:\n###### 1) Merged MYFEATURE into 'develop'.\n###### 2) Removes the feature branch.\n###### 3) Switches back to 'develop' branch\n```\ngit flow feature finish MYFEATURE\n```\n\n##### Publish a feature:\n###### Are you developing a feature in collaboration? Publish a feature to the remote server so it can be used by other users.\n```\ngit flow feature publish MYFEATURE\n```\n\n##### Getting a published feature:\n###### Get a feature published by another user.\n```\ngit flow feature pull origin MYFEATURE\n```\n\n##### Tracking a origin feature:\n###### You can track a feature on origin by using\n```\ngit flow feature track MYFEATURE\n```\n\u003chr\u003e\n\n### Make a Release\n###### Support preparation of a new production release. Allow for minor bug fixes and preparing meta-data for a release\n\n##### Start a release:\n###### To start a release, use the git flow release command. It creates a release branch created from the 'develop' branch. You can optionally supply a [BASE] commit sha-1 hash to start the release from. The commit must be on the 'develop' branch.\n```\ngit flow release start RELEASE [BASE]\n```\n###### It's wise to publish the release branch after creating it to allow release commits by other developers. Do it similar to feature publishing with the command:\n```\ngit flow release publish RELEASE\n```\n###### (You can track a remote release with the: ```git flow release track RELEASE``` command)\n\n##### Finish up a release:\n###### Finishing a release is one of the big steps in git branching. It performs several actions:\n###### 1) Merges the release branch back into 'master'\n###### 2) Tags the release with its name\n###### 3) Back-merges the release into 'develop'\n###### 4) Removes the release branch\n```\ngit flow release finish RELEASE\n```\n###### Don't forget to push your tags with ```git push --tags```\n\n\u003chr\u003e\n\n### Hotfixes\n###### Hotfixes arise from the necessity to act immediately upon an undesired state of a live production version. May be branched off from the corresponding tag on the master branch that marks the production version.\n\n##### Git flow hotfix start:\n###### Like the other git flow commands, a hotfix is started with\n```\n$ git flow hotfix start VERSION [BASENAME]\n```\n###### The version argument hereby marks the new hotfix release name. Optionally you can specify a basename to start from.\n\n##### Finish a hotfix:\n###### By finishing a hotfix it gets merged back into develop and master. Additionally the master merge is tagged with the hotfix version\n```\ngit flow hotfix finish VERSION\n```\n\u003chr\u003e\n\n### Commands\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Git\" src=\"./images/git-flow-commands.png\" height=\"270\" width=\"460\"\u003e\n\u003c/p\u003e\n\u003chr\u003e\n\n### Git flow schema\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Git\" src=\"images/git-flow-commands-without-flow.png\"\u003e\n\u003c/p\u003e\n\u003chr\u003e\n\nGit Tips\n===============\n\n* [Everyday Git in twenty commands or so](#everyday-git-in-twenty-commands-or-so)\n* [Show helpful guides that come with Git](#show-helpful-guides-that-come-with-git)\n* [Search change by content](#search-change-by-content)\n* [Remove sensitive data from history, after a push](#remove-sensitive-data-from-history-after-a-push)\n* [Sync with remote, overwrite local changes](#sync-with-remote-overwrite-local-changes)\n* [List of all files till a commit](#list-of-all-files-till-a-commit)\n* [Git reset first commit](#git-reset-first-commit)\n* [List all the conflicted files](#list-all-the-conflicted-files)\n* [List of all files changed in a commit](#list-of-all-files-changed-in-a-commit)\n* [Unstaged changes since last commit](#unstaged-changes-since-last-commit)\n* [Changes staged for commit](#changes-staged-for-commit)\n* [Show both staged and unstaged changes](#show-both-staged-and-unstaged-changes)\n* [List all branches that are already merged into master](#list-all-branches-that-are-already-merged-into-master)\n* [Quickly switch to the previous branch](#quickly-switch-to-the-previous-branch)\n* [Remove branches that have already been merged with master](#remove-branches-that-have-already-been-merged-with-master)\n* [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)\n* [Track upstream branch](#track-upstream-branch)\n* [Delete local branch](#delete-local-branch)\n* [Delete remote branch](#delete-remote-branch)\n* [Delete local tag](#delete-local-tag)\n* [Delete remote tag](#delete-remote-tag)\n* [Undo local changes with the last content in head](#undo-local-changes-with-the-last-content-in-head)\n* [Revert: Undo a commit by creating a new commit](#revert-undo-a-commit-by-creating-a-new-commit)\n* [Reset: Discard commits, advised for private branch](#reset-discard-commits-advised-for-private-branch)\n* [Reword the previous commit message](#reword-the-previous-commit-message)\n* [See commit history for just the current branch](#see-commit-history-for-just-the-current-branch)\n* [Amend author.](#amend-author)\n* [Reset author, after author has been changed in the global config.](#reset-author-after-author-has-been-changed-in-the-global-config)\n* [Changing a remote's URL](#changing-a-remotes-url)\n* [Get list of all remote references](#get-list-of-all-remote-references)\n* [Get list of all local and remote branches](#get-list-of-all-local-and-remote-branches)\n* [Get only remote branches](#get-only-remote-branches)\n* [Stage parts of a changed file, instead of the entire file](#stage-parts-of-a-changed-file-instead-of-the-entire-file)\n* [Get git bash completion](#get-git-bash-completion)\n* [What changed since two weeks?](#what-changed-since-two-weeks)\n* [See all commits made since forking from master](#see-all-commits-made-since-forking-from-master)\n* [Pick commits across branches using cherry-pick](#pick-commits-across-branches-using-cherry-pick)\n* [Find out branches containing commit-hash](#find-out-branches-containing-commit-hash)\n* [Git Aliases](#git-aliases)\n* [Saving current state of tracked files without commiting](#saving-current-state-of-tracked-files-without-commiting)\n* [Saving current state of unstaged changes to tracked files](#saving-current-state-of-unstaged-changes-to-tracked-files)\n* [Saving current state including untracked files](#saving-current-state-including-untracked-files)\n* [Saving current state with message](#saving-current-state-with-message)\n* [Saving current state of all files (ignored, untracked, and tracked)](#saving-current-state-of-all-files-ignored-untracked-and-tracked)\n* [Show list of all saved stashes](#show-list-of-all-saved-stashes)\n* [Apply any stash without deleting from the stashed list](#apply-any-stash-without-deleting-from-the-stashed-list)\n* [Apply last stashed state and delete it from stashed list](#apply-last-stashed-state-and-delete-it-from-stashed-list)\n* [Delete all stored stashes](#delete-all-stored-stashes)\n* [Grab a single file from a stash](#grab-a-single-file-from-a-stash)\n* [Show all tracked files](#show-all-tracked-files)\n* [Show all untracked files](#show-all-untracked-files)\n* [Show all ignored files](#show-all-ignored-files)\n* [Create new working tree from a repository (git 2.5)](#create-new-working-tree-from-a-repository-git-25)\n* [Create new working tree from HEAD state](#create-new-working-tree-from-head-state)\n* [Untrack files without deleting](#untrack-files-without-deleting)\n* [Before deleting untracked files/directory, do a dry run to get the list of these files/directories](#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories)\n* [Forcefully remove untracked files](#forcefully-remove-untracked-files)\n* [Forcefully remove untracked directory](#forcefully-remove-untracked-directory)\n* [Update all the submodules](#update-all-the-submodules)\n* [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)\n* [Rename a branch](#rename-a-branch)\n* [Rebases 'feature' to 'master' and merges it in to master ](#rebases-feature-to-master-and-merges-it-in-to-master)\n* [Archive the `master` branch](#archive-the-master-branch)\n* [Modify previous commit without modifying the commit message](#modify-previous-commit-without-modifying-the-commit-message)\n* [Prunes references to remote branches that have been deleted in the remote.](#prunes-references-to-remote-branches-that-have-been-deleted-in-the-remote)\n* [Retrieve the commit hash of the initial revision.](#retrieve-the-commit-hash-of-the-initial-revision)\n* [Visualize the version tree.](#visualize-the-version-tree)\n* [Visualize the tree including commits that are only referenced from reflogs](#visualize-the-tree-including-commits-that-are-only-referenced-from-reflogs)\n* [Deploying git tracked subfolder to gh-pages](#deploying-git-tracked-subfolder-to-gh-pages)\n* [Adding a project to repo using subtree](#adding-a-project-to-repo-using-subtree)\n* [Get latest changes in your repo for a linked project using subtree](#get-latest-changes-in-your-repo-for-a-linked-project-using-subtree)\n* [Export a branch with history to a file.](#export-a-branch-with-history-to-a-file)\n* [Import from a bundle](#import-from-a-bundle)\n* [Get the name of current branch.](#get-the-name-of-current-branch)\n* [Ignore one file on commit (e.g. Changelog).](#ignore-one-file-on-commit-eg-changelog)\n* [Stash changes before rebasing](#stash-changes-before-rebasing)\n* [Fetch pull request by ID to a local branch](#fetch-pull-request-by-id-to-a-local-branch)\n* [Show the most recent tag on the current branch.](#show-the-most-recent-tag-on-the-current-branch)\n* [Show inline word diff.](#show-inline-word-diff)\n* [Show changes using common diff tools.](#show-changes-using-common-diff-tools)\n* [Don’t consider changes for tracked file.](#dont-consider-changes-for-tracked-file)\n* [Undo assume-unchanged.](#undo-assume-unchanged)\n* [Clean the files from `.gitignore`.](#clean-the-files-from-gitignore)\n* [Restore deleted file.](#restore-deleted-file)\n* [Restore file to a specific commit-hash](#restore-file-to-a-specific-commit-hash)\n* [Always rebase instead of merge on pull.](#always-rebase-instead-of-merge-on-pull)\n* [List all the alias and configs.](#list-all-the-alias-and-configs)\n* [Make git case sensitive.](#make-git-case-sensitive)\n* [Add custom editors.](#add-custom-editors)\n* [Auto correct typos.](#auto-correct-typos)\n* [Check if the change was a part of a release.](#check-if-the-change-was-a-part-of-a-release)\n* [Dry run. (any command that supports dry-run flag should do.)](#dry-run-any-command-that-supports-dry-run-flag-should-do)\n* [Marks your commit as a fix of a previous commit.](#marks-your-commit-as-a-fix-of-a-previous-commit)\n* [Squash fixup commits normal commits.](#squash-fixup-commits-normal-commits)\n* [Skip staging area during commit.](#skip-staging-area-during-commit)\n* [Interactive staging.](#interactive-staging)\n* [List ignored files.](#list-ignored-files)\n* [Status of ignored files.](#status-of-ignored-files)\n* [Commits in Branch1 that are not in Branch2](#commits-in-branch1-that-are-not-in-branch2)\n* [List n last commits](#list-n-last-commits)\n* [Reuse recorded resolution, record and reuse previous conflicts resolutions.](#reuse-recorded-resolution-record-and-reuse-previous-conflicts-resolutions)\n* [Open all conflicted files in an editor.](#open-all-conflicted-files-in-an-editor)\n* [Count unpacked number of objects and their disk consumption.](#count-unpacked-number-of-objects-and-their-disk-consumption)\n* [Prune all unreachable objects from the object database.](#prune-all-unreachable-objects-from-the-object-database)\n* [Instantly browse your working repository in gitweb.](#instantly-browse-your-working-repository-in-gitweb)\n* [View the GPG signatures in the commit log](#view-the-gpg-signatures-in-the-commit-log)\n* [Remove entry in the global config.](#remove-entry-in-the-global-config)\n* [Checkout a new branch without any history](#checkout-a-new-branch-without-any-history)\n* [Extract file from another branch.](#extract-file-from-another-branch)\n* [List only the root and merge commits.](#list-only-the-root-and-merge-commits)\n* [Change previous two commits with an interactive rebase.](#change-previous-two-commits-with-an-interactive-rebase)\n* [List all branch is WIP](#list-all-branch-is-wip)\n* [Find guilty with binary search](#find-guilty-with-binary-search)\n* [Bypass pre-commit and commit-msg githooks](#bypass-pre-commit-and-commit-msg-githooks)\n* [List commits and changes to a specific file (even through renaming)](#list-commits-and-changes-to-a-specific-file-even-through-renaming)\n* [Clone a single branch](#clone-a-single-branch)\n* [Create and switch new branch](#create-and-switch-new-branch)\n* [Ignore file mode changes on commits](#ignore-file-mode-changes-on-commits)\n* [Turn off git colored terminal output](#turn-off-git-colored-terminal-output)\n* [Specific color settings](#specific-color-settings)\n* [Show all local branches ordered by recent commits](#show-all-local-branches-ordered-by-recent-commits)\n* [Find lines matching the pattern (regex or string) in tracked files](#find-lines-matching-the-pattern-regex-or-string-in-tracked-files)\n* [Clone a shallow copy of a repository](#clone-a-shallow-copy-of-a-repository)\n* [Search Commit log across all branches for given text](#search-commit-log-across-all-branches-for-given-text)\n* [Get first commit in a branch (from master)](#get-first-commit-in-a-branch-from-master)\n* [Unstaging Staged file](#unstaging-staged-file)\n* [Force push to Remote Repository](#force-push-to-remote-repository)\n* [Adding Remote name](#adding-remote-name)\n* [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)\n* [Group commits by authors and title](#group-commits-by-authors-and-title)\n* [Forced push but still ensure you don't overwrite other's work](#forced-push-but-still-ensure-you-dont-overwrite-others-work)\n* [Show how many lines does an author contribute](#show-how-many-lines-does-an-author-contribute)\n* [Revert: Reverting an entire merge](#revert-reverting-an-entire-merge)\n* [Number of commits in a branch](#number-of-commits-in-a-branch)\n* [Alias: git undo](#alias-git-undo)\n* [Add object notes](#add-object-notes)\n* [Show all the git-notes](#show-all-the-git-notes)\n* [Apply commit from another repository](#apply-commit-from-another-repository)\n* [Specific fetch reference](#specific-fetch-reference)\n* [Find common ancestor of two branches](#find-common-ancestor-of-two-branches)\n* [List unpushed git commits](#list-unpushed-git-commits)\n* [Add everything, but whitespace changes](#add-everything-but-whitespace-changes)\n* [Edit [local/global] git config](#edit-localglobal-git-config)\n* [blame on certain range](#blame-on-certain-range)\n* [Show a Git logical variable.](#show-a-git-logical-variable)\n* [Preformatted patch file.](#preformatted-patch-file)\n* [Get the repo name.](#get-the-repo-name)\n* [logs between date range](#logs-between-date-range)\n* [Exclude author from logs](#exclude-author-from-logs)\n* [Generates a summary of pending changes](#generates-a-summary-of-pending-changes)\n* [List references in a remote repository](#list-references-in-a-remote-repository)\n* [Backup untracked files.](#backup-untracked-files)\n* [List all git aliases](#list-all-git-aliases)\n* [Show git status short](#show-git-status-short)\n* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago)\n* [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track)\n* [Change a branch base](#change-a-branch-base)\n* [Use SSH instead of HTTPs for remotes](#use-ssh-instead-of-https-for-remotes)\n\n\u003c!-- Don’t remove or change the comment below – that can break automatic updates. More info at \u003chttp://npm.im/doxie.inject\u003e. --\u003e\n\u003c!-- @doxie.inject end toc --\u003e\n\n\n\u003c!-- @doxie.inject start --\u003e\n\u003c!-- Don’t remove or change the comment above – that can break automatic updates. --\u003e\n## Everyday Git in twenty commands or so\n```sh\ngit help everyday\n```\n\n## Show helpful guides that come with Git\n```sh\ngit help -g\n```\n\n## Search change by content\n```sh\ngit log -S'\u003ca term in the source\u003e'\n```\n\n## Remove sensitive data from history, after a push\n```sh\ngit filter-branch --force --index-filter 'git rm --cached --ignore-unmatch \u003cpath-to-your-file\u003e' --prune-empty --tag-name-filter cat -- --all \u0026\u0026 git push origin --force --all\n```\n\n## Sync with remote, overwrite local changes\n```sh\ngit fetch origin \u0026\u0026 git reset --hard origin/master \u0026\u0026 git clean -f -d\n```\n\n## List of all files till a commit\n```sh\ngit ls-tree --name-only -r \u003ccommit-ish\u003e\n```\n\n## Git reset first commit\n```sh\ngit update-ref -d HEAD\n```\n\n## List all the conflicted files\n```sh\ngit diff --name-only --diff-filter=U\n```\n\n## List of all files changed in a commit\n```sh\ngit diff-tree --no-commit-id --name-only -r \u003ccommit-ish\u003e\n```\n\n## Unstaged changes since last commit\n```sh\ngit diff\n```\n\n## Changes staged for commit\n```sh\ngit diff --cached\n```\n\n\n__Alternatives:__\n```sh\ngit diff --staged\n```\n\n## Show both staged and unstaged changes\n```sh\ngit diff HEAD\n```\n\n## List all branches that are already merged into master\n```sh\ngit branch --merged master\n```\n\n## Quickly switch to the previous branch\n```sh\ngit checkout -\n```\n\n\n__Alternatives:__\n```sh\ngit checkout @{-1}\n```\n\n## Remove branches that have already been merged with master\n```sh\ngit branch --merged master | grep -v '^\\*' | xargs -n 1 git branch -d\n```\n\n\n__Alternatives:__\n```sh\ngit branch --merged master | grep -v '^\\*\\|  master' | xargs -n 1 git branch -d # will not delete master if master is not checked out\n```\n\n## List all branches and their upstreams, as well as last commit on branch\n```sh\ngit branch -vv\n```\n\n## Track upstream branch\n```sh\ngit branch -u origin/mybranch\n```\n\n## Delete local branch\n```sh\ngit branch -d \u003clocal_branchname\u003e\n```\n\n## Delete remote branch\n```sh\ngit push origin --delete \u003cremote_branchname\u003e\n```\n\n\n__Alternatives:__\n```sh\ngit push origin :\u003cremote_branchname\u003e\n```\n\n## Delete local tag\n```sh\ngit tag -d \u003ctag-name\u003e\n```\n\n## Delete remote tag\n```sh\ngit push origin :refs/tags/\u003ctag-name\u003e\n```\n\n## Undo local changes with the last content in head\n```sh\ngit checkout -- \u003cfile_name\u003e\n```\n\n## Revert: Undo a commit by creating a new commit\n```sh\ngit revert \u003ccommit-ish\u003e\n```\n\n## Reset: Discard commits, advised for private branch\n```sh\ngit reset \u003ccommit-ish\u003e\n```\n\n## Reword the previous commit message\n```sh\ngit commit -v --amend\n```\n\n## See commit history for just the current branch\n```sh\ngit cherry -v master\n```\n\n## Amend author.\n```sh\ngit commit --amend --author='Author Name \u003cemail@address.com\u003e'\n```\n\n## Reset author, after author has been changed in the global config.\n```sh\ngit commit --amend --reset-author --no-edit\n```\n\n## Changing a remote's URL\n```sh\ngit remote set-url origin \u003cURL\u003e\n```\n\n## Get list of all remote references\n```sh\ngit remote\n```\n\n\n__Alternatives:__\n```sh\ngit remote show\n```\n\n## Get list of all local and remote branches\n```sh\ngit branch -a\n```\n\n## Get only remote branches\n```sh\ngit branch -r\n```\n\n## Stage parts of a changed file, instead of the entire file\n```sh\ngit add -p\n```\n\n## Get git bash completion\n```sh\ncurl -L http://git.io/vfhol \u003e ~/.git-completion.bash \u0026\u0026 echo '[ -f ~/.git-completion.bash ] \u0026\u0026 . ~/.git-completion.bash' \u003e\u003e ~/.bashrc\n```\n\n## What changed since two weeks?\n```sh\ngit log --no-merges --raw --since='2 weeks ago'\n```\n\n\n__Alternatives:__\n```sh\ngit whatchanged --since='2 weeks ago'\n```\n\n## See all commits made since forking from master\n```sh\ngit log --no-merges --stat --reverse master..\n```\n\n## Pick commits across branches using cherry-pick\n```sh\ngit checkout \u003cbranch-name\u003e \u0026\u0026 git cherry-pick \u003ccommit-ish\u003e\n```\n\n## Find out branches containing commit-hash\n```sh\ngit branch -a --contains \u003ccommit-ish\u003e\n```\n\n\n__Alternatives:__\n```sh\ngit branch --contains \u003ccommit-ish\u003e\n```\n\n## Git Aliases\n```sh\ngit config --global alias.\u003chandle\u003e \u003ccommand\u003e \ngit config --global alias.st status\n```\n\n## Saving current state of tracked files without commiting\n```sh\ngit stash\n```\n\n\n__Alternatives:__\n```sh\ngit stash save\n```\n\n## Saving current state of unstaged changes to tracked files\n```sh\ngit stash -k\n```\n\n\n__Alternatives:__\n```sh\ngit stash --keep-index\n```\n\n\n```sh\ngit stash save --keep-index\n```\n\n## Saving current state including untracked files\n```sh\ngit stash -u\n```\n\n\n__Alternatives:__\n```sh\ngit stash save -u\n```\n\n\n```sh\ngit stash save --include-untracked\n```\n\n## Saving current state with message\n```sh\ngit stash save \u003cmessage\u003e\n```\n\n## Saving current state of all files (ignored, untracked, and tracked)\n```sh\ngit stash -a\n```\n\n\n__Alternatives:__\n```sh\ngit stash --all\n```\n\n\n```sh\ngit stash save --all\n```\n\n## Show list of all saved stashes\n```sh\ngit stash list\n```\n\n## Apply any stash without deleting from the stashed list\n```sh\ngit stash apply \u003cstash@{n}\u003e\n```\n\n## Apply last stashed state and delete it from stashed list\n```sh\ngit stash pop\n```\n\n\n__Alternatives:__\n```sh\ngit stash apply stash@{0} \u0026\u0026 git stash drop stash@{0}\n```\n\n## Delete all stored stashes\n```sh\ngit stash clear\n```\n\n\n__Alternatives:__\n```sh\ngit stash drop \u003cstash@{n}\u003e\n```\n\n## Grab a single file from a stash\n```sh\ngit checkout \u003cstash@{n}\u003e -- \u003cfile_path\u003e\n```\n\n\n__Alternatives:__\n```sh\ngit checkout stash@{0} -- \u003cfile_path\u003e\n```\n\n## Show all tracked files\n```sh\ngit ls-files -t\n```\n\n## Show all untracked files\n```sh\ngit ls-files --others\n```\n\n## Show all ignored files\n```sh\ngit ls-files --others -i --exclude-standard\n```\n\n## Create new working tree from a repository (git 2.5)\n```sh\ngit worktree add -b \u003cbranch-name\u003e \u003cpath\u003e \u003cstart-point\u003e\n```\n\n## Create new working tree from HEAD state\n```sh\ngit worktree add --detach \u003cpath\u003e HEAD\n```\n\n## Untrack files without deleting\n```sh\ngit rm --cached \u003cfile_path\u003e\n```\n\n\n__Alternatives:__\n```sh\ngit rm --cached -r \u003cdirectory_path\u003e\n```\n\n## Before deleting untracked files/directory, do a dry run to get the list of these files/directories\n```sh\ngit clean -n\n```\n\n## Forcefully remove untracked files\n```sh\ngit clean -f\n```\n\n## Forcefully remove untracked directory\n```sh\ngit clean -f -d\n```\n\n## Update all the submodules\n```sh\ngit submodule foreach git pull\n```\n\n\n__Alternatives:__\n```sh\ngit submodule update --init --recursive\n```\n\n\n```sh\ngit submodule update --remote\n```\n\n## Show all commits in the current branch yet to be merged to master\n```sh\ngit cherry -v master\n```\n\n\n__Alternatives:__\n```sh\ngit cherry -v master \u003cbranch-to-be-merged\u003e\n```\n\n## Rename a branch\n```sh\ngit branch -m \u003cnew-branch-name\u003e\n```\n\n\n__Alternatives:__\n```sh\ngit branch -m [\u003cold-branch-name\u003e] \u003cnew-branch-name\u003e\n```\n\n## Rebases 'feature' to 'master' and merges it in to master \n```sh\ngit rebase master feature \u0026\u0026 git checkout master \u0026\u0026 git merge -\n```\n\n## Archive the `master` branch\n```sh\ngit archive master --format=zip --output=master.zip\n```\n\n## Modify previous commit without modifying the commit message\n```sh\ngit add --all \u0026\u0026 git commit --amend --no-edit\n```\n\n## Prunes references to remote branches that have been deleted in the remote.\n```sh\ngit fetch -p\n```\n\n\n__Alternatives:__\n```sh\ngit remote prune origin\n```\n\n## Retrieve the commit hash of the initial revision.\n```sh\n git rev-list --reverse HEAD | head -1\n```\n\n\n__Alternatives:__\n```sh\ngit rev-list --max-parents=0 HEAD\n```\n\n\n```sh\ngit log --pretty=oneline | tail -1 | cut -c 1-40\n```\n\n\n```sh\ngit log --pretty=oneline --reverse | head -1 | cut -c 1-40\n```\n\n## Visualize the version tree.\n```sh\ngit log --pretty=oneline --graph --decorate --all\n```\n\n\n__Alternatives:__\n```sh\ngitk --all\n```\n\n\n```sh\ngit log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d'\n```\n\n## Visualize the tree including commits that are only referenced from reflogs\n```sh\ngit log --graph --decorate --oneline $(git rev-list --walk-reflogs --all)\n```\n\n## Deploying git tracked subfolder to gh-pages\n```sh\ngit subtree push --prefix subfolder_name origin gh-pages\n```\n\n## Adding a project to repo using subtree\n```sh\ngit subtree add --prefix=\u003cdirectory_name\u003e/\u003cproject_name\u003e --squash git@github.com:\u003cusername\u003e/\u003cproject_name\u003e.git master\n```\n\n## Get latest changes in your repo for a linked project using subtree\n```sh\ngit subtree pull --prefix=\u003cdirectory_name\u003e/\u003cproject_name\u003e --squash git@github.com:\u003cusername\u003e/\u003cproject_name\u003e.git master\n```\n\n## Export a branch with history to a file.\n```sh\ngit bundle create \u003cfile\u003e \u003cbranch-name\u003e\n```\n\n## Import from a bundle\n```sh\ngit clone repo.bundle \u003crepo-dir\u003e -b \u003cbranch-name\u003e\n```\n\n## Get the name of current branch.\n```sh\ngit rev-parse --abbrev-ref HEAD\n```\n\n## Ignore one file on commit (e.g. Changelog).\n```sh\ngit update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog\n```\n\n## Stash changes before rebasing\n```sh\ngit rebase --autostash\n```\n\n## Fetch pull request by ID to a local branch\n```sh\ngit fetch origin pull/\u003cid\u003e/head:\u003cbranch-name\u003e\n```\n\n\n__Alternatives:__\n```sh\ngit pull origin pull/\u003cid\u003e/head:\u003cbranch-name\u003e\n```\n\n## Show the most recent tag on the current branch.\n```sh\ngit describe --tags --abbrev=0\n```\n\n## Show inline word diff.\n```sh\ngit diff --word-diff\n```\n\n## Show changes using common diff tools.\n```sh\ngit difftool [-t \u003ctool\u003e] \u003ccommit1\u003e \u003ccommit2\u003e \u003cpath\u003e\n```\n\n## Don’t consider changes for tracked file.\n```sh\ngit update-index --assume-unchanged \u003cfile_name\u003e\n```\n\n## Undo assume-unchanged.\n```sh\ngit update-index --no-assume-unchanged \u003cfile_name\u003e\n```\n\n## Clean the files from `.gitignore`.\n```sh\ngit clean -X -f\n```\n\n## Restore deleted file.\n```sh\ngit checkout \u003cdeleting_commit\u003e^ -- \u003cfile_path\u003e\n```\n\n## Restore file to a specific commit-hash\n```sh\ngit checkout \u003ccommit-ish\u003e -- \u003cfile_path\u003e\n```\n\n## Always rebase instead of merge on pull.\n```sh\ngit config --global pull.rebase true\n```\n\n\n__Alternatives:__\n```sh\n#git \u003c 1.7.9\ngit config --global branch.autosetuprebase always\n```\n\n## List all the alias and configs.\n```sh\ngit config --list\n```\n\n## Make git case sensitive.\n```sh\ngit config --global core.ignorecase false\n```\n\n## Add custom editors.\n```sh\ngit config --global core.editor '$EDITOR'\n```\n\n## Auto correct typos.\n```sh\ngit config --global help.autocorrect 1\n```\n\n## Check if the change was a part of a release.\n```sh\ngit name-rev --name-only \u003cSHA-1\u003e\n```\n\n## Dry run. (any command that supports dry-run flag should do.)\n```sh\ngit clean -fd --dry-run\n```\n\n## Marks your commit as a fix of a previous commit.\n```sh\ngit commit --fixup \u003cSHA-1\u003e\n```\n\n## Squash fixup commits normal commits.\n```sh\ngit rebase -i --autosquash\n```\n\n## Skip staging area during commit.\n```sh\ngit commit --only \u003cfile_path\u003e\n```\n\n## Interactive staging.\n```sh\ngit add -i\n```\n\n## List ignored files.\n```sh\ngit check-ignore *\n```\n\n## Status of ignored files.\n```sh\ngit status --ignored\n```\n\n## Commits in Branch1 that are not in Branch2\n```sh\ngit log Branch1 ^Branch2\n```\n\n## List n last commits\n```sh\ngit log -\u003cn\u003e\n```\n\n\n__Alternatives:__\n```sh\ngit log -n \u003cn\u003e\n```\n\n## Reuse recorded resolution, record and reuse previous conflicts resolutions.\n```sh\ngit config --global rerere.enabled 1\n```\n\n## Open all conflicted files in an editor.\n```sh\ngit diff --name-only | uniq | xargs $EDITOR\n```\n\n## Count unpacked number of objects and their disk consumption.\n```sh\ngit count-objects --human-readable\n```\n\n## Prune all unreachable objects from the object database.\n```sh\ngit gc --prune=now --aggressive\n```\n\n## Instantly browse your working repository in gitweb.\n```sh\ngit instaweb [--local] [--httpd=\u003chttpd\u003e] [--port=\u003cport\u003e] [--browser=\u003cbrowser\u003e]\n```\n\n## View the GPG signatures in the commit log\n```sh\ngit log --show-signature\n```\n\n## Remove entry in the global config.\n```sh\ngit config --global --unset \u003centry-name\u003e\n```\n\n## Checkout a new branch without any history\n```sh\ngit checkout --orphan \u003cbranch_name\u003e\n```\n\n## Extract file from another branch.\n```sh\ngit show \u003cbranch_name\u003e:\u003cfile_name\u003e\n```\n\n## List only the root and merge commits.\n```sh\ngit log --first-parent\n```\n\n## Change previous two commits with an interactive rebase.\n```sh\ngit rebase --interactive HEAD~2\n```\n\n## List all branch is WIP\n```sh\ngit checkout master \u0026\u0026 git branch --no-merged\n```\n\n## Find guilty with binary search\n```sh\ngit 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\n```\n\n## Bypass pre-commit and commit-msg githooks\n```sh\ngit commit --no-verify\n```\n\n## List commits and changes to a specific file (even through renaming)\n```sh\ngit log --follow -p -- \u003cfile_path\u003e\n```\n\n## Clone a single branch\n```sh\ngit clone -b \u003cbranch-name\u003e --single-branch https://github.com/user/repo.git\n```\n\n## Create and switch new branch\n```sh\ngit checkout -b \u003cbranch-name\u003e\n```\n\n\n__Alternatives:__\n```sh\ngit branch \u003cbranch-name\u003e \u0026\u0026 git checkout \u003cbranch-name\u003e\n```\n\n## Ignore file mode changes on commits\n```sh\ngit config core.fileMode false\n```\n\n## Turn off git colored terminal output\n```sh\ngit config --global color.ui false\n```\n\n## Specific color settings\n```sh\ngit config --global \u003cspecific command e.g branch, diff\u003e \u003ctrue, false or always\u003e\n```\n\n## Show all local branches ordered by recent commits\n```sh\ngit for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/\n```\n\n## Find lines matching the pattern (regex or string) in tracked files\n```sh\ngit grep --heading --line-number 'foo bar'\n```\n\n## Clone a shallow copy of a repository\n```sh\ngit clone https://github.com/user/repo.git --depth 1\n```\n\n## Search Commit log across all branches for given text\n```sh\ngit log --all --grep='\u003cgiven-text\u003e'\n```\n\n## Get first commit in a branch (from master)\n```sh\ngit log --oneline master..\u003cbranch-name\u003e | tail -1\n```\n\n\n__Alternatives:__\n```sh\ngit log --reverse master..\u003cbranch-name\u003e | head -6\n```\n\n## Unstaging Staged file\n```sh\ngit reset HEAD \u003cfile-name\u003e\n```\n\n## Force push to Remote Repository\n```sh\ngit push -f \u003cremote-name\u003e \u003cbranch-name\u003e\n```\n\n## Adding Remote name\n```sh\ngit remote add \u003cremote-nickname\u003e \u003cremote-url\u003e\n```\n\n## Show the author, time and last revision made to each line of a given file\n```sh\ngit blame \u003cfile-name\u003e\n```\n\n## Group commits by authors and title\n```sh\ngit shortlog\n```\n\n## Forced push but still ensure you don't overwrite other's work\n```sh\ngit push --force-with-lease \u003cremote-name\u003e \u003cbranch-name\u003e\n```\n\n## Show how many lines does an author contribute\n```sh\ngit log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += \u003c!-- @doxie.inject start --\u003e; subs += \u003c!-- @doxie.inject end --\u003e; loc += \u003c!-- @doxie.inject start --\u003e - \u003c!-- @doxie.inject end --\u003e } END { printf \"added lines: %s removed lines: %s total lines: %s\n\", add, subs, loc }' -\n```\n\n\n__Alternatives:__\n```sh\ngit log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += \u003c!-- @doxie.inject start --\u003e; subs += \u003c!-- @doxie.inject end --\u003e; loc += \u003c!-- @doxie.inject start --\u003e - \u003c!-- @doxie.inject end --\u003e } END { printf \"added lines: %s, removed lines: %s, total lines: %s\n\", add, subs, loc }' - # on Mac OSX\n```\n\n## Revert: Reverting an entire merge\n```sh\ngit revert -m 1 \u003ccommit-ish\u003e\n```\n\n## Number of commits in a branch\n```sh\ngit rev-list --count \u003cbranch-name\u003e\n```\n\n## Alias: git undo\n```sh\ngit config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'\n```\n\n## Add object notes\n```sh\ngit notes add -m 'Note on the previous commit....'\n```\n\n## Show all the git-notes\n```sh\ngit log --show-notes='*'\n```\n\n## Apply commit from another repository\n```sh\ngit --git-dir=\u003csource-dir\u003e/.git format-patch -k -1 --stdout \u003cSHA1\u003e | git am -3 -k\n```\n\n## Specific fetch reference\n```sh\ngit fetch origin master:refs/remotes/origin/mymaster\n```\n\n## Find common ancestor of two branches\n```sh\ngit merge-base \u003cbranch-name\u003e \u003cother-branch-name\u003e\n```\n\n## List unpushed git commits\n```sh\ngit log --branches --not --remotes\n```\n\n\n__Alternatives:__\n```sh\ngit log @{u}..\n```\n\n\n```sh\ngit cherry -v\n```\n\n## Add everything, but whitespace changes\n```sh\ngit diff --ignore-all-space | git apply --cached\n```\n\n## Edit [local/global] git config\n```sh\ngit config [--global] --edit\n```\n\n## blame on certain range\n```sh\ngit blame -L \u003cstart\u003e,\u003cend\u003e\n```\n\n## Show a Git logical variable.\n```sh\ngit var -l | \u003cvariable\u003e\n```\n\n## Preformatted patch file.\n```sh\ngit format-patch -M upstream..topic\n```\n\n## Get the repo name.\n```sh\ngit rev-parse --show-toplevel\n```\n\n## logs between date range\n```sh\ngit log --since='FEB 1 2017' --until='FEB 14 2017'\n```\n\n## Exclude author from logs\n```sh\ngit log --perl-regexp --author='^((?!excluded-author-regex).*)\n\n```\n\n## Generates a summary of pending changes\n```sh\ngit request-pull v1.0 https://git.ko.xz/project master:for-linus\n```\n\n## List references in a remote repository\n```sh\ngit ls-remote git://git.kernel.org/pub/scm/git/git.git\n```\n\n## Backup untracked files.\n```sh\ngit ls-files --others -i --exclude-standard | xargs zip untracked.zip\n```\n\n## List all git aliases\n```sh\ngit config -l | grep alias | sed 's/^alias\\.//g'\n```\n\n\n__Alternatives:__\n```sh\ngit config -l | grep alias | cut -d '.' -f 2\n```\n\n## Show git status short\n```sh\ngit status --short --branch\n```\n\n## Checkout a commit prior to a day ago\n```sh\ngit checkout master@{yesterday}\n```\n\n## Push a new local branch to remote repository and track\n```sh\ngit push -u origin \u003cbranch_name\u003e\n```\n\n## Change a branch base\n```sh\ngit rebase --onto \u003cnew_base\u003e \u003cold_base\u003e\n```\n\n## Use SSH instead of HTTPs for remotes\n```sh\ngit config --global url.'git@github.com:'.insteadOf 'https://github.com/'\n```\n\n\u003c!-- Don’t remove or change the comment below – that can break automatic updates. More info at \u003chttp://npm.im/doxie.inject\u003e. --\u003e\n\u003c!-- @doxie.inject end --\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinavkorpal%2Fgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhinavkorpal%2Fgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhinavkorpal%2Fgit/lists"}