git add -N file.txt

Category: Git - Core

git add -N file.txt

Mark a new file as intent-to-add

The -N flag registers a new file so git diff and git diff --stat start showing its content before it is staged. The file appears in the index as empty rather than untracked. Follow up with git add when you are ready to stage the real content.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.