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).
Published at
2023-09-14 13:57:14Event JSON
{
"id": "d3c0ae38c733f8907c92fceb975e3723ea321cc649515a5b250eb4fa129e509c",
"pubkey": "1c916e3126795bb0d5ae867e590cca6f61e7359762647d2847427b23b541e04b",
"created_at": 1694699834,
"kind": 1,
"tags": [
[
"proxy",
"https://fosstodon.org/users/whynothugo/statuses/111063848373728588",
"activitypub"
]
],
"content": "TIL about git-add's -N/--intent-to-add flag. This adds the file to the index without updating any content.\n\nI 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.\n\nIt also makes the new content visible with `git diff` (which usually ignores untracked files).",
"sig": "e93d043e17ac16babc976ad776e0696dd8aaf68597da455a318c57c52344a926a6326d400049106b277b6f8247ab152c33b9b38fda67aa86ee37352d5a3d4398"
}