'git add --patch' to include new files?
问题 When I run git add -p , is there a way for git to select newly made files as hunks to select?? So if I make a new file called foo.java , then run git add -p, git will not let me choose that file's content to be added into the index. 回答1: To do this with every new files, you can run: git add -N . git add -p If you want to use it frequently, you can create an alias in your ~/.bashrc : alias gapan='git add --intent-to-add . && git add --patch' N.B : If you use this with an empty new file, git