Sign In

git add -N <path>

Mark a new file as intent-to-add so it appears in git diff without staging its contents.

This command is useful when you want Git to recognize that a new file exists and should be tracked, but you are not ready to stage its contents yet. It marks the file as “intent-to-add” so it shows up in comparisons and review workflows without committing to its current contents.

The -N flag (also written as --intent-to-add) records the existence of the new file at <path> in the index, but does not stage any of its lines as added content. The <path> parameter specifies the file or directory you want to mark; it can be a single file like app/config.yml, a directory like src/, or a path pattern that Git can resolve.

  • Example: git add -N src/new_feature.py
  • Example: git add -N docs/api/new-endpoints.md
  • Example: git add -N config/dev.env.example
Manual page
git add
Related commands

Sign in to Git Examples