takeshin takeshin - 1 month ago 6x
Git Question

git: stage only new files

When I have:

  • dirty working directory,

  • dirty staging area,

  • and I copied some new files to the project,

how do I stage only the new ones?

git alias adduntracked=…


This alias will respect your ignore patterns (builtin, global and per-directory, as described by the help for git-ls-files --exclude-standard). It will run at the top level of your tree.

adduntracked=!git add $(git ls-files -o --exclude-standard)