【问题标题】:git doesn't auto commit when I pull当我拉动时,git不会自动提交
【发布时间】:2014-12-01 02:48:05
【问题描述】:

出于某种原因,每当我从 master 拉取数据时,git 都不会自动将更改提交到我的本地分支。我收到以下错误:

/usr/bin/mate -w: /usr/bin/mate: No such file or directory
error: There was a problem with the editor '/usr/bin/mate -w'.
Not committing merge; use 'git commit' to complete the merge.

我必须在拉取后手动进行提交。这只是在我设置新机器后才开始,而在我的旧机器上从未发生过。任何帮助表示赞赏。

【问题讨论】:

  • 你安装了文本伴侣吗?
  • 您是否阅读了错误信息? Git 找不到您的文本编辑器 (TextMate)。确保它已安装并且mate 在您的路径上。
  • @Jubobs 所有这些完整的路径让我觉得这不是$PATH 的问题。
  • @Biffen TextMate 甚至可能没有安装在 OP 的新机器上,但 Git 可能已配置为使用它。
  • @Jubobs 是的。这与$PATH 变量无关。

标签: git git-pull


【解决方案1】:

如果我在一些玩具本地存储库中设置我的核心编辑器,我可以重现你的问题

git config core.editor "/usr/bin/mate -w"

然后尝试运行使用编辑器的命令:

$ git commit
/usr/bin/mate -w: /usr/bin/mate: No such file or directory
error: There was a problem with the editor '/usr/bin/mate -w'.
Please supply the message using either -m or -F option.

我收到此错误是因为我的机器上没有名为 /usr/bin/mate 的文件或目录(我没有安装 TextMate)。

由于类似的原因,您遇到了类似的错误:TextMate 安装在您的计算机上但未安装在 /usr/bin/mate,或者根本没有安装。你应该

  1. 使用您机器上已经安装的文本编辑器;或者,
  2. 如果您坚持使用TextMate,请确保它已实际安装;然后运行

    git config core.editor "<path_to_mate> -w"
    

    或者,将mate 添加到您的路径并简单地运行

    git config core.editor "mate -w"
    

【讨论】:

  • 我使用 Ruby mine 作为我的文本编辑器我没有在任何地方安装 textmate
  • 您在以前的机器上使用 RubyMine 作为 Git 的编辑器吗?我认为 Git 不允许您使用 IDE 作为其核心编辑器。
  • 或者您的意思是您在 RubyMine 中使用 Git?
  • 您可以通过运行 git config core.editor 来确定 Git 配置为使用哪个编辑器,但我们没有得到任何结果,因为您还没有回答我的问题:您在什么意义上使用或想要在 Git 中使用 RubyMine?
  • @ruby_newbie 太奇怪了...我刚查了Git源码,消息There was a problem with the editor只在你的核心编辑器有问题的时候使用(即配置Git的编辑器)使用)。但是如果你的核心编辑器是vim,为什么Git会抱怨mate?...请运行以下测试:cd ~; mkdir test_git_editor &amp;&amp; cd test_git_editor; git init; touch README; git add README; git commit。如果你收到一条错误消息,它会说什么?
猜你喜欢
  • 1970-01-01
  • 2021-10-12
  • 2014-10-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-21
  • 2020-06-07
相关资源
最近更新 更多