Skip to content

Instantly share code, notes, and snippets.

@mt3
Forked from irace/gist:3366283
Created October 21, 2012 07:01
Show Gist options
  • Save mt3/3926205 to your computer and use it in GitHub Desktop.
Save mt3/3926205 to your computer and use it in GitHub Desktop.
Git cheat sheet
# 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