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条回答
Evening l夕情丶
2楼-- · 2019-03-11 19:21

A temporary workaround is to make a commit without the files that are causing the problem. Check the bad files off the commit list, do a local commit but don't push to the server, i.e. the button with circling arrows must not be green. Then go to your IDE, copy the content of the classes/files somewhere, then delete the problematic file. Create a new file and paste. Restart the github app, then do a commit with these new ones and then you can push. Worked for me.

I'm using v.185 (Responder Train).

查看更多
爷、活的狠高调
3楼-- · 2019-03-11 19:23

My silly way to resolve this is to copy every files I needed and deleted the folder, then created a new folder with the same name and copied them back. It actually worked for me. I'm new to github and don't know how to find out the previously existing git file (though I did know it was probably caused by conflict between old and new config files). It's better to learn how github works to use it as a tool better. But for now, if you want to have a quick solution, mine might work for you.

查看更多
相关推荐>>
4楼-- · 2019-03-11 19:24

This is a weird error.

It seems to be a permissions error as indicated by git (command line), but persists even if permissions are 777.

What worked for me was going into terminal, cding into the directory, and manually adding it to the index.

So you would do:

cd <WHEREVER-YOUR-PROJECT-IS>/laravel-master/
sudo git add vendor/illuminate/remote/Illuminate/Remote/
sudo git add vendor/anahkiasen/rocketeer/

And then try the GitHub utility again.

Let me know if it works!

查看更多
你好瞎i
5楼-- · 2019-03-11 19:25

Thought this might be work adding in here...

When I tried to commit my changes, I still had Xcode open. As such, the Github utility has issues adding files due to some security thing. I closed Xcode, but the error persisted in the Github utility. I had to close, and reopen the Github utility before it would work.

Food for thought!

查看更多
登录 后发表回答