git doesn't auto commit when I pull

偶尔善良 提交于 2019-12-12 02:26:17

问题


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.


回答1:


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"
    


来源:https://stackoverflow.com/questions/26223074/git-doesnt-auto-commit-when-i-pull

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!