aaraza
12/10/2017 - 11:09 PM

Useful Git Commands

# Remove a file and all it's history from Git
# Useful for removing sensative information

git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch <path-to-file>' \
--prune-empty --tag-name-filter cat -- --all

# Remove all untracked files
git ls-files --others --exclude-standard | xargs rm