开发者

git command to add/stage modified files in folders only

I've modified several files in a folder and subfolders. I could add the top folder rec开发者_Go百科ursively but then i have several subfolders that are untracked, so every time I do the recursive add to stage changes, I have to untrack the subfolders with git rm -r --cached. Is there a better way to just stage the modifications that show up in git status, without tracking already explicitly untracked files?

meta-question: is it really a good idea that git add means two (or more) things? in this context, if the command to track files (git add) were not the same used for stage modifications (git add) then i would not have this problem in the first place


git add -u adds only modifications. Also consider adding files which you don't want to track to .gitignore file.


I think what you're looking for is

git commit -a

This will let you commit changes only.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜