1

I was doing a commit in a local repository which was taking longer than I was expecting, I realized that I was committing a recently added large file so I decided to cancel by doing Ctrl-C.

I proceeded to add the large file to .gitignore and tried doing git add and git commit again.

The first time I tried I got an error indicating that index.lock existed, so I removed it manually. After git add I tried git commit but now I get the fatal: error when closing sha1 file: Permission denied

Is there something else I need to manually remove before being able to perform commits again?

dugar
  • 305
  • 1
  • 7

1 Answers1

1

It can depends on your OS and Git version (Git 2.19+, for instance, changes the way it deals with lock files)

But if nothing else work, try and clone your repo again, to report your current modification on it, then add and commit from the new cloned repo.

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • I ended up re cloning and adding the modifications, I looked for an easier fix but at the end it did not take so much time to do this. – dugar Feb 16 '19 at 23:40
  • @dugar OK. I mentioned that option as a practical way to move forward, but I agree it is not the easiest solution. – VonC Feb 17 '19 at 20:34