Hello
I'm getting the following error message when I try to add file(s) using SourceTree.
git -c diff.mnemonicprefix=false -c core.quotepath=false add -f -- readme.txt
warning: LF will be replaced by CRLF in readme.txt.
The file will have its original line endings in your working directory.
error: unable to write sha1 filename .git/objects/1c/18a9e638b2dea1aa7c81bf21900faef855bc0d: Permission denied
error: readme.txt: failed to insert into database
error: unable to index file readme.txt
fatal: adding files failed
I'm using BitBucket and there is a private repository and trying to commit and push.
As a first time user of Git, BitBucket and SourceTree, I might have made a mistake but can't find what the problem is.... Any help or tip would be appreciated.
Many thanks in advance
Jun
I ran into this error when some items in the .git/objects folder were owned by root rather than my user account. In other words, you might check the permissions on that folder.
Thanks guys.
I first had a go Ian's suggestion as it looked a bit easier to try and the error seems came from the permission issue.
Just for other people who might hit the same problem.
I use Windows and the server, where all my works are, is running on Mac. Although I had set the folder permission as read&write, SourceTree was still not able to save(write) to the folder. So that I recreated a folder on my computer(local machine) and it just worked!
I now know what caused the issue and will need to speak to a network manager.
Cheers~!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jun,
This is a result of something going wrong with Git rather than SourceTree. This issue has been highly reported and the solutions are varying. One simple solution is to recursively chmod your repository folder to the user that's going to be committing. This is provided that user should have access to the various files. You can issue the following command:
chmod -R 644 <dir>
Make sure this is run from the project directory. If this doesn't work then we can look at alternate solutions from there.
Hope that helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.