git subree push丢失了我的提交消息

时间:2014-05-11 01:43:40

标签: git git-subtree

我的主仓库my-subtree中有一个git子树my-repo,它链接到一个远程仓库。 我在my-subtree中提交了属于my-repo的文件。

然后我想将这些更改推回到远程仓库,所以我运行了这个命令

git subtree push --prefix=remote_repos/my-subtree --squash git@github.com:my-userame/my-subtree master

它推动了更改,但git commit消息丢失了!我收到了这条消息

Merge commit '64cda2e4fd5e166e79cfc8e3c1edffa3fae40308'

当我执行git subtree push时,如何将原始git消息放入远程仓库?得到Merge commit消息的意思?

1 个答案:

答案 0 :(得分:0)

您可以在contrib/subtree/git-subtree.sh代码的许多地方找到add_squashed_msg中的代码:

add_squashed_msg()
{
  if [ -n "$message" ]; then
    echo "$message"
  else
    echo "Merge commit '$1' as '$2'"
  fi
}

指的是subtree option -m

  

m,message=使用给定的消息作为合并提交的提交消息   ' split'

的选项

(注意:这不仅仅适用于' split')

-m设置为last commit message

相关问题