git oneliners

delete commits until a specific one

git log # shows the hashes of all commits
git reset --hard <hash of the commit to reset to>

.gitignore files that are already tracked

add to .gitignore
git rm --cached files/to/remove  # starting from $GIT_DIR not /

.DS_Store stuff

remove from repository

find . -name .DS_Store -type f -exec git rm {} \;

add line

.DS_Store

to .gitignore and add the file to tracking if its not already

git add .gitignore
git commit -m ".DS_Store banished!"

.gitignore .DS_Store globally

git config --global core.excludesfile = /Users/username/.gitignore

add line

.DS_Store

to the .gitignore-file from the first command

/var/www/virtual/ben/wiki.firefly-it.de/data/pages/linux/software/desktop/git.txt · Last modified: 2010/02/03 18:51 by zero
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0