标签云

微信群

扫码加入我们

WeChat QR Code

I'm getting the weirdest message it git$ git status# On branch master# Changes not staged for commit:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: folder/test.txt# modified: tesitng.txt# no changes added to commit (use "git add" and/or "git commit -a")Which one is it? If I commit now, will there be changes added to the repo as the modified message shows or will there be no changes added to commit ?


Don't worry, you'll get much weirder ones.

2019年04月19日24分19秒

but when I type git -a -m "msg" it commits it just fine

2019年04月19日24分19秒

Yes, it would: the -a means that you just did two things, stage all changes, and then commit.

2019年04月19日24分19秒

but when I type git -a -m "msg" it commits it just fine

2019年04月19日24分19秒

but when I type git -a -m "msg" it commits it just fine

2019年04月19日24分19秒

yes. the -a is a shortcut for "stage all the changes". that's convenient most of the time.but some of the time you want to stage only some of the changes, then you have to do that step explicitly.

2019年04月19日24分19秒