Skip to content

Instantly share code, notes, and snippets.

@lightscalar
Last active September 27, 2015 21:47
Show Gist options
  • Save lightscalar/1336726 to your computer and use it in GitHub Desktop.
Save lightscalar/1336726 to your computer and use it in GitHub Desktop.
Git Tips

Some Useful Git Tips

Configuration

Turn on command line colors. Just do this:

git config color.ui true

Also, and this is a huge time saver: to stage all deleted for files for GIT deletion, simply call:

git add -u

This will update all tracked files, and stage for deletion all those that were deleted. This obviates the need to manually delete each of the files. It avoids the need to explicitly call,

git rm file_name

for each file that has been deleted.

To remove all the .DS_Store files in your repository (because you forgot to add it to the .gitignore file):

find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment