Skip to content

Instantly share code, notes, and snippets.

@chalasr
Last active January 8, 2016 22:52
Show Gist options
  • Save chalasr/96ae1b10518065440286 to your computer and use it in GitHub Desktop.
Save chalasr/96ae1b10518065440286 to your computer and use it in GitHub Desktop.
Exclude specific extension from git add

Exclude files with ".php~" from GIT ADD :

git ls-files . | grep '\.php~$' | xargs git add

Exclude files already added by GIT ADD :

git ls-files . | grep '\.php~$' | xargs git reset --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment