Skip to content

Instantly share code, notes, and snippets.

View stepmr's full-sized avatar

Stephen Marie-Rhodes stepmr

View GitHub Profile
@stepmr
stepmr / gist:ca870649dc3f72f45576dff12f466a9d
Created February 24, 2019 18:29 — forked from jojoom/gist:2907289
Ryan Singer's Reading List
People often ask me for a reading list. Here are my most common recommendations.
STARTERS:
The Visual Display of Quantitative Information - Edward Tufte
http://www.amazon.com/Visual-Display-Quantitative-Information/dp/0961392142/ref=sr_1_1?ie=UTF8&qid=1327537840&sr=8-1
Hot Text: Web Writing that Works - Lisa and Jonathan Price
(Excellent before/after examples)
After editing .gitignore to match the ignored files, you can do git ls-files -ci --exclude-standard to see the files that are included in the exclude lists; you can then do git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached to remove them from the repository (without deleting them from disk).
Edit: You can also add this as an alias in your .gitconfig file so you can run it anytime you like. Just add the following line under the [alias] section:
apply-gitignore = !git ls-files -ci --exclude-standard -z | xargs -0r git rm --cached
(The -r flag in xargs prevents git rm from running on an empty result and printing out its usage message.)
Now you can just type git apply-gitignore in your repo, and it'll do the work for you!