Running Sourcetree 2.0.3 on Mac OSX 10.10.1 and attempting to commit a change. When I click the Stage hunk button I receive the error:
'git apply' failed with code 128:'fatal: Unable to create '/Users/.../.git/index.lock': Permission denied'
I cannot commit changes.
I am able to do this through Terminal if a add sudo. My guess it is a permissions thing somewher, but I cannot figure it out.
Any help will be greatly appreciated.
Check the ownership of the .git folder. It should be writable by your user. If that is not the problem, check whether the index.lock file exists, and you may need to delete the lock file manually, but only if you're sure git isn't performing any operations (shut down sourcetree to avoid colliding with automatic fetches).
Thank you, Seth.
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/13/7_nt5m7x6zv4v0f5cftwvry40000gp/T/SourceTreeTemp.epR05C
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write commit object
Completed with errors, see above
When I look at these items in terminal they are all owned by root, but not my user. Why is this? Can I change all he ownership under .git to my user with 'chown -R'?
I think that should work, but my knowledge is based on linux, not Mac, so you may want to get a second opinion before attempting that. If everything is owned by root, it's likely that the command you used to create them (git clone?) was executed as root (probably via sudo, based on reference to that in your question). In practice, I would avoid using the "sudo" command in your user's directory for any operation other than changing ownership to your user.
Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...
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