GitHub Client on OS X Commit Fail ("Failed to add

2019-03-11 18:40发布

I am trying to commit changes I have made to my code (as usual) from my GitHub client on my Mac OS X Mavericks machine. I added a new package to my project (it's a Laravel project, and I added the package Rocketeer. I also made a few config changes).

I am getting the error:

Failed to add file laravel-master/vendor/anahki  

When I uncheck this file in the commit list, it then goes to another file showing this error.

Failed to add file laravel-master/vendor/illumin

Any idea what is going on? I have never run into these issues. Thank you.

EDIT:

I have narrowed this down to two files that are not being allowed to commit (this is for a Laravel project):

These are the errors I get when I try to commit these two folders/files:

Failed to add file laravel-master/vendor/illuminate/remote/Illuminate/Remote/ to index.

Failed to add file laravel-master/vendor/anahkiasen/rocketeer/ to index.

10条回答
We Are One
2楼-- · 2019-03-11 19:06

There might be different causes for the problem. For me, the file permissions were changed.

Run the following commands on the terminal :

$ cd <path>
$ chmod u+rw file.py
查看更多
走好不送
3楼-- · 2019-03-11 19:07

Check to see if you have Xcode installed. There was a EULA agreement I needed to agree to before it would allow me to commit

查看更多
干净又极端
4楼-- · 2019-03-11 19:13

This was annoying me for weeks! I had to keep going into terminal and adding each file and committing from the terminal which isnt as nice as using the app.

I finally contacted GitHub support and they advised me that they were aware of the issue and are releasing a fix soon.

Open up your terminal or shell and navigate to the repository and enter:

git config --local core.safecrlf false


This will disable the core.safeclrf property for the repository which is causing the issue.

That should work :)

Note: I am using the Mac version of the GitHub app (A New Hope (180))

查看更多
Viruses.
5楼-- · 2019-03-11 19:17

In my case, there was already a .git directory from another imported third-party git repository. I had to removed it, anything worked well.

查看更多
爷的心禁止访问
6楼-- · 2019-03-11 19:17

I had the same problem. There was an existing .git repository at the location i wanted to create the new one. I deleted it and created a new one. Now committing works as expected.

If you aren't sure if there might be an existing .git at the target location of your repository, do this (on a Unix machine):

$> cd <path>
$> ls -aef 

This should show you the hidden files (like .git). Now you have two options: either delete the .git directory

$> sudo rm -R .git

or change the owner rights.

查看更多
forever°为你锁心
7楼-- · 2019-03-11 19:18

In my case, I solved the problem by manually creating a new folder. For example, I want to move a folder named "echarts" into my github repo. I just created a folder with the name echarts, and then copy the files in echarts and paste to the folder. It involves no git script.

查看更多
登录 后发表回答