By default if I use git add
, it directly adds the file to staged area.
I want it ,to add it to, unstaged area only. How to do that ?
You might be looking for --intent-to-add
option:
-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
.
This will add the file to index as an empty one, which will make git diff
show all of its contents as "added".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With