Hugo on Nostr: TIL about git-add's -N/--intent-to-add flag. This adds the file to the index without ...
TIL about git-add's -N/--intent-to-add flag. This adds the file to the index without updating any content.
I use `git add -up` a lot. Using `git add -N /path/to/file` first adds an empty file to the index, so when I later use `git add -up`, I'm prompted with the chunk containing the new file's body. This lets me have one last review of the new file before actually adding/committing.
It also makes the new content visible with `git diff` (which usually ignores untracked files).
I use `git add -up` a lot. Using `git add -N /path/to/file` first adds an empty file to the index, so when I later use `git add -up`, I'm prompted with the chunk containing the new file's body. This lets me have one last review of the new file before actually adding/committing.
It also makes the new content visible with `git diff` (which usually ignores untracked files).