Couldn't checkout HEAD Unable to create branch

Answered

'/home/user/PycharmProjects/ExampleProject/ExampleRepository/.git/index.lock': permission denied 

Im getting this error when trying to create a new branch in PyCharm. I've attempted changing the permissions on the .git/index.lock file but this doesn't work. I still am getting this error. I've looked all over but haven't gotten any answers. 

0
3 comments

Hi,

Does it work from the terminal?

0
Avatar
Permanently deleted user

I have the branches directory set to drw-rw-r-- and user:user and it still isn't giving me access to create a new branch in pycharm. I do have access to the Directory in terminal, yes. 

0

@... the error which you observe is thrown by git. 
Could you please check whether you are able to create a new branch via terminal?

Please check which user owns a .git foler by running:

ls -la /home/user/PycharmProjects/ExampleProject/ExampleRepository/ 

It may worth to change ownership to user:user for .git as you did for branches directory:

sudo chown -R <owner>:<group> .git 

0

Please sign in to leave a comment.