Skip to content

Instantly share code, notes, and snippets.

@jgdavey
Created March 30, 2012 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgdavey/2256047 to your computer and use it in GitHub Desktop.
Save jgdavey/2256047 to your computer and use it in GitHub Desktop.
Git alias to add untracked files
[alias]
add-untracked = !"git status --porcelain | awk '/\\?\\?/{ print $2 }' | xargs git add"
@fjfish
Copy link

fjfish commented Apr 14, 2012

What's wrong with

git add --all

I have an alias aa

 aa = add --all

@jgdavey
Copy link
Author

jgdavey commented Apr 14, 2012

This is actually the opposite of git add --all.

@fjfish
Copy link

fjfish commented Apr 14, 2012

It does add the untracked and the tracked - I agree it does more than just the untracked. So yeah, if your intent is untracked only --all doesn't work.

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