subl' --wait' 在合并分支时不起作用 [Git]



我阅读了几篇关于Git 2.10发布说明中漂亮属性的文章。将git升级到2.10.0,并对全局.gitconfig进行了更改,结果如下-

[filter "lfs"]
    clean = git-lfs clean %f
    smudge = git-lfs smudge %f
    required = true
[user]
    name = xyz
    email = abc.def@gmail.com
    signingkey = AAAAAAA
[core]
    excludesfile = /Users/xyz/.gitignore_global
    editor = 'subl' --wait   <!--this is where its failing I guess--!>
[difftool "sourcetree"]
    cmd = opendiff "$LOCAL" "$REMOTE"
    path = 
[mergetool "sourcetree"]
    cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"
    trustExitCode = true
[alias]
    lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[color "diff"]
    old = red strike
    new = green italic

但是现在当我尝试像下面这样执行git命令时,我在控制台上没有得到任何进度细节或正确的消息显示。

➜  automation git:(branch1) git pull origin master
From https://github.com/XYZ/automation
 * branch            master     -> FETCH_HEAD
Auto-merging pom.xml
Auto-merging test/pom.xml
'subl' --wait: subl: command not found
error: There was a problem with the editor ''subl' --wait'.
Not committing merge; use 'git commit' to complete the merge.

更新:发布@Arvin关于重复的评论

如果我按照这里的解决方案使用

更改默认的git编辑器
git config --global core.editor "subl -n -w"

我仍然得到

subl -n -w: subl: command not found error: There was a problem with编辑器'subl -n -w'.

这篇文章应该会有所帮助-我如何使Sublime Text成为Git的默认编辑器?

说明-

Sublime Text 2 (Build 2181)

最新版本2181刚刚添加了对-w (wait)命令行参数的支持。下面的配置将允许ST2作为Windows上的默认git编辑器。这将允许git打开ST2来接收提交消息等。
git config --global core.editor "'c:/program files/sublime text 2/sublime_text.exe' -w"

Sublime Text 3 (Build 3065)

Sublime Text 3 (Build 3065)增加了subl.exe命令行助手。使用subl.exe -h作为可用的选项。我在我的Sublime Text用户设置中设置了hot_exit: trueremember_open_files: true。我发现下面的git配置对我来说工作得很好。

git config --global core.editor "'c:/program files/sublime text 3/subl.exe' -w"

使用这个git配置,在我的编辑器中打开一个新的选项卡。我编辑我的提交信息,保存选项卡并关闭它(CTRL+w)。Git会等到选项卡关闭后再继续它的工作。

最新更新