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

时间:2017-07-31 23:21:12

标签: git git-pull

好吧,我们再来一次更多的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的选项是什么,“这是要使用的消息。不要让自己感到困惑。不要用无用的废话浪费我的时间吗?”

提前致谢

2 个答案:

答案 0 :(得分:1)

您无法提供自己的消息,但传递给--no-edit的{​​{1}}选项会自动生成合并消息。

git pull

答案 1 :(得分:0)

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

git pull --no-edit  &&  git commit --amend -m "my new message"