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'?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Seth.
I did try this and it worked. Thanks for the warning about sudo.
Jedidiah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to help. If you hit the checkbox by my answer, that will highlight it as the "correct" answer.
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.