版本控制 - git merge的時候總是會有一條commit message,請問這是操作不當嗎?
phpcn_u1582
phpcn_u1582 2017-04-25 09:03:34
0
1
954

分支情況:

  dev
  location
* master
  new

操作的時候使用指令:

git merge location

然後會出現commit message的註解

請問各位是什麼地方出錯了?

phpcn_u1582
phpcn_u1582

全部回覆(1)
phpcn_u1582

沒有錯…
如果你使用git help merge,就会看到git merge的文檔。
然後它提到:

Then "git merge topic" will replay the changes made on the topic branch since it perged from master (i.e., E) until its current commit (C) on top of master,and record the resultil its current commit (C) on top of master,and record the result in a new name along of the two parent commits and a log message from the user describing the changes.

merge前

                  A---B---C topic
                /
           D---E---F---G master

merge後

                 A---B---C topic
                /         \
           D---E---F---G---H master

所以說,那個commit message是自動加入的。

如果你實在討厭這個commit,可以在merge時加上--no-commit。這樣就不會產生commit message了。不過我不推薦這麼做,這樣的話,就不容易分辨merge的結果了。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板