Skip to content

Instantly share code, notes, and snippets.

@leonardortlima
Created October 25, 2017 13:20
Show Gist options
  • Save leonardortlima/c604d44a16033184b7f98b152bb88750 to your computer and use it in GitHub Desktop.
Save leonardortlima/c604d44a16033184b7f98b152bb88750 to your computer and use it in GitHub Desktop.
Adds the "apply-gitignore" command to git, which remove entries that are in .gitignore but are still tracked.
# Appended to ~/.gitconfig file
# https://stackoverflow.com/a/7532131
[alias]
apply-gitignore = !git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached
@ettoreleandrotognoli
Copy link

ettoreleandrotognoli commented Apr 26, 2018

remove all not selected merged branches

clean-branches = !sh -c 'git branch -d $(git branch | grep "^[^*]")'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment