-1

I'm trying to add a few files to git.

Issue is I'm having this error fatal: Impossible de créer '/home/andy_k/Documents/dev/forsure/.git/index.lock' : Permission not granted

According to this answer, doing a rm -f ./.git/index.lock should be enough.

But there is no such file.

Any ideas on what should be my next step?

Thanks

Andy K
  • 4,944
  • 10
  • 53
  • 82
  • 1
    Looks like you don’t have permission to create files within `.git`. Do you own it and have write permission? – Biffen Dec 12 '18 at 10:50

2 Answers2

0

It seems like a permission problem. Are you the owner of the folder .get? (If not use chown command to change it) The Permission should be "rwxrwxr-x" (775) (you can change it with the command chmod)

0

Check the owner of the .git folder in the directory using (considering you have linux/mac OS)

ls -l -a

if the owner is other then current user, then

sudo chown -R <current_username> .git

Then again try committing files.

Nimish Gupta
  • 971
  • 7
  • 17