Skip to main content

TIL: Show Intent to add a File in git

· One min read
Christoph Beck

If you add a new file to your code which you want to add to git later, you can show that intent early with git add --intent-to-add. This is quite useful when want to add new files to the index (so you don’t forget about them later), but you’re still working on them and don’t want to add the content just yet 🥳

This is what the git documentation says:

-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 with git commit -a.
Christoph Beck

Christoph Beck

Head of Intergalactic Mischief

We're hiring

Work with our great team, apply for one of the open positions at bitcrowd