What is Nostr?
Hugo /
npub1rjg…8qa2
2023-09-14 13:57:14

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).
Author Public Key
npub1rjgkuvfx09dmp4dwsel9jrx2das7wdvhvfj862z8gfaj8d2pup9sf58qa2