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
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.
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
Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs