Alex Rivera | Logout

git: stage only new files

Asked 2010-09-14T08:11:51.733
11

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=…
Edit
Report

1 Answer

0

git add -u is what I use to stage untracked.

Edit: comments below have reminded me that its git add . that adds untracked (along with changed files, which I think is not what you want?). I use the git add -u to stage deleted files.

answered 2010-09-14T08:17:56.197

Your Answer