2

当我执行git merge --squash <source_branch>导致冲突的操作时,来自 Git 的预定义提交消息内容仅包含冲突信息,而不包含压缩提交的摘要。

λ git merge --squash <source_branch>
Auto-merging res/strings_us/c4d_strings.str
CONFLICT (content): Merge conflict in res/strings_us/c4d_strings.str
Auto-merging res/config.ini
CONFLICT (content): Merge conflict in res/config.ini
Auto-merging readme.md
Squash commit -- not updating HEAD
Automatic merge failed; fix conflicts and then commit the result.
λ # resolve conflicts ...
λ git add res
λ git commit
Conflicts:
  res/config.ini
  res/strings_us/c4d_strings.str

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch <branch_name>
# Changes to be committed:
# modified:   res/config.ini
# modified:   res/strings_us/c4d_strings.str

如何让 Git 也包含有关已被压缩的提交的信息?通常 Git 会写“Squash of the following commits:”,然后显示git log已放入 squashed 提交中的提交。

使用 git 版本 1.9.5.msysgit.1

4

0 回答 0