You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.
Glad to help. If you hit the checkbox by my answer, that will highlight it as the "correct" answer.