Skip to content

Instantly share code, notes, and snippets.

@jorwan
Forked from frangeris/commands.md
Last active August 29, 2015 14:06
Show Gist options
  • Save jorwan/ecdf58fcc1634beff382 to your computer and use it in GitHub Desktop.
Save jorwan/ecdf58fcc1634beff382 to your computer and use it in GitHub Desktop.
GIT
===
[PUBLIC REPO] https://www.kernel.org/pub/software/scm/git/
[DELETE ALL RM] git rm $(git ls-files --deleted)
[DELETE BRANCH DOWN] git branch <branchName> --delete
[DELETE BRANCH UP] git push origin --delete <branchName>
[DONT TRACK CHANGES] git update-index --assume-unchanged <file>
[TRACK CHANGES] git update-index --no-assume-unchanged <file>
[LIST HIDDEN TRACKS] git ls-files -v | grep '^[[:lower:]]'
[CLEANING UP CACHE WHEN GIT IGNORE FAIL]
git rm -r --cached .
git add .
git commit -m "Fixed untracked files"
[CLONE BRANCH] git clone -b <branch> git@<domain>:<user>/<myproject>.git
[IGNORE MODE FILE] git config core.fileMode false
[CHECKOUT DOESN'T WORK] git config --global core.autocrlf false
[GIT COLOR] git config --global color.ui true
[ROLLING BACK A COMMIT] git reset --soft 'HEAD^'
[DISCARD LAST COMMIT] git reset HEAD --hard
git reset --hard origin/master
[ACCEPT THEIRS MERGE] git checkout --theirs
[ACCEPT OURS MERGE] git checkout --ours
[REMOVE REMOTE] git remote rm <remote>
[PROBLEM CRLF SEQUENCE] git diff --ignore-space-at-eol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment