简体   繁体   English

git merge workingbranch后,如何消除错误“错误:无法运行sublime:没有这样的文件或目录”

[英]After git merge workingbranch, how to remove the error "error: cannot run sublime: No such file or directory"

I'm using git on my terminal trying to merge the changes from my working branch to the master.我在我的终端上使用 git 试图将更改从我的工作分支合并到主分支。 I use the merge command and get an error that says "cannot run sublime:No such file or directory."我使用合并命令并收到一条错误消息,提示“无法运行 sublime:没有这样的文件或目录”。 and "unable to start editor 'sublime'."和“无法启动编辑器‘崇高’。”

I do not have sublime on my computer and do not want to use it.我的电脑上没有 sublime,也不想使用它。 I would just like to get rid of these errors.我只想摆脱这些错误。

I continued on by adding, committing, and pushing the changes, and I saw that everything is now successfully showing up in Github.我继续添加、提交和推送更改,我看到现在一切都成功地显示在 Github 中。 So it looks like the merge command successfully let me integrate my changes from the working branch to the master.所以看起来合并命令成功地让我将我的更改从工作分支集成到主分支。

I checked my computer by searching for "sublime" in Launchpad and Finder, and I do not have the Sublime editor.我通过在 Launchpad 和 Finder 中搜索“sublime”来检查我的计算机,但我没有 Sublime 编辑器。 I vaguely remember installing it once to try it out.我依稀记得安装过一次尝试一下。 But I seem to have uninstalled it.不过我好像卸载了。

Sheilas-MBP:violinportfolio Sheila$ git merge working --no-ff Sheilas-MBP:violinportfolio Sheila$ git merge 工作 --no-ff

error: cannot run sublime: No such file or directory错误:无法运行 sublime:没有这样的文件或目录

error: unable to start editor 'sublime'错误:无法启动编辑器“崇高”

Not committing merge;不提交合并; use 'git commit' to complete the merge.使用“git commit”完成合并。

Either your system Git is configured to use sublime as the system-default editor (which seems unlikely), or you configured Git to use sublime as your default editor (which seems pretty likely).无论你的系统Git的配置为使用升华为系统默认的编辑器(这似乎不太可能),或者你配置GIT中使用升华为默认编辑器(这似乎是相当有可能的)。

The one bit of trouble here is finding out how you configured this, because there are a lot of ways to configure it.这里的一个小麻烦是找出您如何配置它,因为有很多方法可以配置它。 The most common method is to use the core.editor setting:最常用的方法是使用core.editor设置:

git config --get core.editor

may print sublime , in which case you can use git config again to un -set that, and/or to choose whatever editor you do prefer.可能会打印sublime ,在这种情况下,您可以再次使用git config取消设置,和/或选择您喜欢的任何编辑器。

In general, if you're setting your core.editor preference, you would want to use git config --global , as this sets your personal default for all Git repositories.通常,如果您要设置core.editor首选项,您会想要使用git config --global ,因为这会为所有Git 存储库设置您的个人默认值。 So if you want to use, say, vim , you would run:因此,如果您想使用vim ,则可以运行:

git config --global core.editor vim

Presumably, you did this earlier to set it to sublime .据推测,您之前这样做是为了将其设置为sublime However, it's possible that you did instead:但是,您可能会这样做:

git config core.editor sublime

earlier.早些时候。 If so, that set sublime as your preferred editor for this particular Git repository only , and that setting will continue to override any global setting.如果是这样,则将 sublime 设置为仅用于此特定 Git 存储库的首选编辑器,并且该设置将继续覆盖任何全局设置。 In that case, you'll need to un-set the local setting:在这种情况下,您需要取消设置本地设置:

git config --unset core.editor

Should you wish to unset your global setting, you can use:如果您希望取消全局设置,您可以使用:

git config --global --unset core.editor

These are not the only places where you can set your preferred editor, but these are the most likely settings.这些不是您可以设置首选编辑器的唯一地方,但这些是最有可能的设置。 The other possibilities are environment variables: $GIT_EDITOR , $VISUAL , and $EDITOR .其他可能性是环境变量: $GIT_EDITOR$VISUAL$EDITOR

Summary概括

  • There are system (all users of this computer), global (all of your repositories on this computer), and local ( this repository right now) settings for Git variables.有系统(该计算机的所有用户),全球(全部此计算机上存储库),以及本地(现在这个库)设置Git的变量。 In the latest version of Git there are even per-work-tree settings that apply if you use git worktree add .在最新版本的 Git 中,如果您使用git worktree add ,甚至还有适用于每个工作树的设置。 Use:用:

     git config --show-origin --list

    to see all settings and where they are set.查看所有设置及其设置位置。

  • The editor to use is chosen from the first one of these that is set:要使用的编辑器是从设置的第一个中选择的:

    • $GIT_EDITOR (in the environment) $GIT_EDITOR (在环境中)
    • core.editor (from all Git configurations) core.editor (来自所有 Git 配置)
    • $VISUAL (in the environment) $VISUAL (在环境中)
    • $EDITOR (in the environment) $EDITOR (在环境中)
    • the compiled-in default (from your Git installation)编译的默认值(来自您的 Git 安装)


    These are the places to inspect for settings, if core.editor is not controlling which editor you use.如果core.editor没有控制您使用的编辑器,这些是检查设置的地方。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Git合并错误:无法运行Sublime_Text_2:没有这样的文件或目录 - Git merge error: cannot run Sublime_Text_2: No such file or directory 如何在Git提交GPG签名期间解决“无法运行--version:无此类文件或目录”错误 - How to fix 'cannot run --version: No such file or directory' error during Git commit GPG signing 修复合并冲突后,每次git return都无法合并错误 - git return cannot merge error everytime after fix merge conflicts git 错误:无法生成更多:没有这样的文件或目录 - git error: cannot spawn more: No such file or directory 我收到一条错误消息 rm: cannot remove '.git/index.lock': No such file or directory - I'm getting an error saying rm: cannot remove '.git/index.lock': No such file or directory Git Merge:错误:无法取消链接旧的<file>:没有这样的文件或目录 - Git Merge: error: unable to unlink old <file>: No such file or directory Intellij导入问题 - java.io.IOException:无法运行程序“git”:error = 2,没有这样的文件或目录 - Intellij import issue - java.io.IOException: Cannot run program “git”: error=2, No such file or directory 合并后的git hook - 错误:无法运行 - git hook post-merge - error: cannot run 错误:无法运行ssh:没有此类文件或目录 - error: cannot run ssh: No such file or directory YOCTO:“错误:无法运行 ssh:没有这样的文件或目录” - YOCTO: "error: cannot run ssh: No such file or directory"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM