开发者

When creating a new git repository with 40,000 things, so I have to uncomment each in the COMMIT file?

Okay, I am confused! I have a directory with ~40,000 files, and I created a git repository.开发者_C百科 I add all the files with:

git add .

then when I type "git commit" I get a 40,000 line text file that opens, and EVERY line is commented. If I close this file without uncommenting anything, it does not perform any commit at all. However, if I uncomment just a single line from this file, it SEEMS to commit all 40,000 files. Is this correct, this seems confusing?


The comments are just showing you what files are being committed.

You need to add a commit message; that's what the editor is prompting you for. Try typing "My first commit" and saving.


Use git commit -m "commit message" when you have just a single line of commit message ( which I feel you mostly should)

Omit the -m if you have a large message and you want git to present you your editor so that you can type the message. Ignore the comments ( they are there to help you see what you are committing), just enter your message, save and quit your editor to commit.


Correct; git doesn't care about the contents of the commit message, as long as there is something uncommented. It doesn't check that your message has anything to do with the files you committed.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜