【问题标题】:Specify custom merge message when using git pull使用 git pull 时指定自定义合并消息
【发布时间】:2020-05-01 12:52:11
【问题描述】:

有没有办法在不使用 --edit 的情况下指定自定义合并消息?

这会调出编辑器:

git pull <some location> --edit

我想要:

git pull <some location> --merge-message "Merge from X"

【问题讨论】:

    标签: git git-pull


    【解决方案1】:

    https://git-scm.com/docs/git-pull#_description:

    git pullgit fetch 后跟git merge 的简写。

    https://git-scm.com/docs/git-merge#Documentation/git-merge.txt--mltmsggt

    git merge(因此git pull)接受-m message 传递消息,-F file 从文件中获取消息。

    【讨论】:

    • 谢谢,这行得通。虽然我使用了本地存储库,所以也需要指定 FETCH_HEAD: git fetch && git merge -m "Merge from other repo" FETCH_HEAD
    猜你喜欢
    • 2016-04-04
    • 1970-01-01
    • 2012-12-15
    • 2013-01-12
    • 2011-02-02
    • 2020-12-18
    • 2014-04-14
    • 1970-01-01
    • 2015-10-30
    相关资源
    最近更新 更多