Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add untracked file to unstaged area in GIT

Tags:

git

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 ?

like image 918
Number945 Avatar asked Oct 13 '17 18:10

Number945


Video Answer


1 Answers

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".

like image 164
xaizek Avatar answered Oct 20 '22 08:10

xaizek