GitHub Client on OS X Commit Fail (\"Failed to add file …)

纵然是瞬间 提交于 2019-12-02 23:44:04

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

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.

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!

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))

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.

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

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!

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.

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

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

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