2013-03-09 53 views
0

添加更新准备提交时,我经常使用git add -pGit add -p但新文件

但是,是否可以对新文件也做同样的事情?它似乎并不仅限于编辑现有文件。

回答

0

命令git add用于将新文件添加到存储库中,并告诉Git您想要一个已更改为下一次提交的文件。

这有很多好处,因为git commit只会提交那些已经明确添加的文件。注意SVN add仅用于将新文件添加到回购站。

 
-p, --patch 
    Interactively choose hunks of patch between the index and the work tree and 
    add them to the index. This gives the user a chance to review the difference 
    before adding modified contents to the index.