Created
October 22, 2009 01:52
-
-
Save aeden/215654 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checkout: | |
git clone url | |
Checkout throwing away local changes: | |
git checkout -f | |
Checkout a single file to get it back to HEAD: | |
git checkout filename | |
Checkout a single file to a specific REV: | |
git checkout REV filename | |
To unstage a single file: | |
git reset HEAD filepath | |
To modify the last commit message | |
git commit --amend | |
To create a local branch: | |
git branch branch_name | |
To create a local branch from a tag: | |
git branch x-y-z x.y.z | |
To push a local branch to the remote: | |
git push origin branch_name | |
To delete a remote branch: | |
git push origin :branch_name | |
To delete a local branch: | |
git branch -d branch_name | |
To checkout and track a remote branch: | |
git checkout --track -b local_branch origin/remote_branch | |
Show remote branches: | |
git remote show origin | |
Add all deleted files: | |
git add -u | |
Log with hash + name + subject (useful with | grep) | |
git log --format=format:"%H %an %s" | |
Generate a giant patch from the current branch against master | |
git format-patch master --stdout | |
Apply a formatted patch | |
git am —3way < /tmp/name.patch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment