简体   繁体   English

Git合并分支不成

[英]Git merge branch without into

What does it mean when i look at git log and see something like this: 当我查看git log并看到类似以下内容时,这是什么意思:

Merge branch 'wtf' of my.site.com:~/repo

Usually It looks like this: 通常看起来像这样:

Merge branch 'wtf' of my.site.com:~/repo into some-other-branch

Which makes perfect sense to me. 这对我来说很有意义。

Note, this particular repo is in a detatched head state and has apparently been this way for some time. 请注意,这个特定的回购处于分离的头部状态,并且显然已经有一段时间了。 I suspect this is the reason for the strange commit message. 我怀疑这是产生奇怪提交消息的原因。

当当前分支是master分支时,合并提交消息中未提及该分支。

As explained above by phd this is the correct answer. 如上phd所述,这是正确的答案。
Let's give some more details into it. 让我们给它一些更多的细节。

Whenever you merge 2 or more branches and the merge will result in a merge commit (for example when --no-ff merge occurs) git will generate the commit message for you. 每当您合并2个或更多分支时,合并将导致merge commit (例如,当--no-ff合并发生时)git将为您生成提交消息。 merge commit is the case when your commits are not producing a straight line, its when you have "derived" from your main commit lines and the merge should add the code back to your "main" line. 当您的提交没有产生一条直线时, merge commit就是这种情况,当您从主要提交行“派生”并且合并应该将代码重新添加到您的“主要”行时。 It will result in a split log graph. 这将导致拆分日志图。

The commit message will include the names of the branches in the format Merge branch X into Y . 提交消息将包含将Merge branch X into Y格式的分支名称。 If the current branch is master, meaning that you merge code into master, git will not add the master to your commit message . 如果当前分支是master,这意味着您将代码合并到master中,则git不会将master添加到您的commit消息中


ff merge (no merge commit) ff合并(无合并提交)

在此处输入图片说明

--no-ff merge (merge commit) --no-ff合并(合并提交)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM