当我拉时,git不会自动提交 [英] git doesn't auto commit when I pull

查看:227
本文介绍了当我拉时,git不会自动提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,每当我从主站点拉,git不会自动提交到我的本地分支的更改。我得到以下错误:

pre $ / usr / bin / mate -w:/ usr / bin / mate:没有这样的文件或目录
错误:编辑器'/ usr / bin / mate -w'出现问题。
不提交合并;使用'git commit'来完成合并。

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

解决方案

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

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

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

  $ git commit 
/ usr / bin / mate -w:/ usr / bin / mate:没有这样的文件或目录
错误:编辑器'/ usr / bin / mate -w'出现问题。
请使用-m或-F选项提供消息。

我得到这个错误是因为没有名为 / usr / bin / mate (我没有安装TextMate)。



类似的错误是类似的理由:要么在你的机器上安装了TextMate而是在 / usr / bin / mate 中安装了TextMate ,否则它根本就没有安装。您应该使用已安装在您的计算机上的文本编辑器来完成


  1. 或者,如果您坚持使用TextMate,请确保它实际上已安装,否则
  2. 然后运行

      git config core.editor< path_to_mate> -w

    或者,将 mate 添加到您的路径中,然后直接运行

      git config core.editormate -w



for some reason whenever I pull from master, git will not auto commit the changes to my local branch. I get the following error:

/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.

and I have to manually do the commit after pulling. This only started since I set up my new machine and never happened on my old one. Any help is appreciated.

解决方案

I can reproduce your problem if I set my core editor in some toy local repository like so

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

and then try to run a command that uses the editor:

$ 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.

I'm getting this error because there is no file or directory called /usr/bin/mate on my machine (I don't have TextMate installed).

You're getting a similar error for a similar reason: either TextMate is installed on your machine but not at /usr/bin/mate, or it's not installed at all. You should either

  1. use a text editor that's already installed on your machine; or,
  2. if you insist on using TextMate, make sure that it is actually installed; then run

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

    Alternatively, add mate to your path and simply run

    git config core.editor "mate -w"
    

这篇关于当我拉时,git不会自动提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆