如何使'git pull'接收消息?

问题描述 投票:0回答:2

好吧,我们再来一次更多的Git善良。它已经找到了让简单任务变得难以实现的其他方法......

git pull -X theirs https://github.com/weidai11/cryptopp.git master
From https://github.com/weidai11/cryptopp
 * branch            master     -> FETCH_HEAD
Auto-merging GNUmakefile
error: cannot spawn notepad++.exe: No such file or directory
error: unable to start editor 'notepad++.exe'
Not committing merge; use 'git commit' to complete the merge.

notepad++.exe几乎是所有其他Windows可执行文件所在的位置。它在程序文件中。它不是秘密,它不是一个隐藏的位置。

再试一次,这样就不会浪费我的时间用无用的垃圾:

# Rewind past broken git
git checkout HEAD~3 -f

# Back to master
git checkout master -f

# Tray again; avoid the prompt
$ git pull -X theirs -m "Sync with Upstream master" https://github.com/weidai11/cryptopp.git master
error: unknown switch `m'
usage: git pull [<options>] [<repository> [<refspec>...]]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting

告诉Git有什么选择,“这是要使用的信息。不要让自己感到困惑。不要浪费我的时间与无用的废话?”

提前致谢

git git-pull
2个回答
2
投票

您无法提供自己的消息,但传递给--no-editgit pull选项将自动生成合并消息。

git pull --no-edit


1
投票

虽然您无法使用一个命令执行此操作,但您可以轻松地使用两个命令:

git pull --no-edit  &&  git commit --amend -m "my new message"
© www.soinside.com 2019 - 2024. All rights reserved.