如何让'git pull'留言?
How to make 'git pull' take a message?
好吧,我们再来一次 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,"Here's the message to use. Stop confusing yourself. Stop wasting my time with useless crap?"
提前致谢
您无法提供自己的消息,但传递给 git pull
的 --no-edit
选项将自动生成合并消息。
git pull --no-edit
虽然您无法用一个命令完成,但您可以轻松地用两个命令完成:
git pull --no-edit && git commit --amend -m "my new message"
好吧,我们再来一次 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,"Here's the message to use. Stop confusing yourself. Stop wasting my time with useless crap?"
提前致谢
您无法提供自己的消息,但传递给 git pull
的 --no-edit
选项将自动生成合并消息。
git pull --no-edit
虽然您无法用一个命令完成,但您可以轻松地用两个命令完成:
git pull --no-edit && git commit --amend -m "my new message"