-
-
Save mt3/3926205 to your computer and use it in GitHub Desktop.
Git cheat sheet
This file contains hidden or 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 remote branch | |
git checkout -t origin/<branch> | |
# Delete branch (local, remote) | |
git branch -d <branch> | |
git push origin --delete <branch> | |
# Submodules | |
git submodule init | |
git submodule update | |
# Merge upstream changes into forked repository | |
git remote add upstream git://github.com/jstn/JXHTTP.git | |
git pull upstream master | |
# Reset forked repository | |
git remote add upstream git://github.com/jstn/JXHTTP.git | |
git fetch upstream | |
git reset --hard upstream/master | |
git push --force | |
# Ignore changes in tracked files | |
git update-index --assume-unchanged <file> | |
git update-index --no-assume-unchanged <file> | |
# Add support for Localizable.strings | |
*.strings diff=localizablestrings # .git/info/attributes | |
[diff "localizablestrings"] # ~/.gitconfig | |
textconv = "iconv -f utf-16 -t utf-8" | |
# Configure GitHub with SSH public keys | |
git clone [email protected]:irace/webzap.git | |
ssh-keygen | |
cat id_rsa.pub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment