Start tracking a file in Git without adding to to the index
You can stage the files using git add
, then git reset
them prior to the commit.
Seems like you're looking for git add --intent-to-add
(or git add -N
). From the official git add
documentation:
-N --intent-to-add
Record only the fact that the path will be added later. An entry for the path is placed in the index with no content. This is useful for, among other things, showing the unstaged content of such files with
git diff
and committing them withgit commit -a
.
See the What does git add --intent-to-add or -N do and when should it be used? question for more information.