0

I am trying to update my react app service. No matter the method the deployment center says it fails and the logs return the next message:

fatal: Unable to create '/home/site/repository/.git/index.lock': File exists.\n\nAnother git process seems to be running in this repository, e.g.\nan editor opened by 'git commit'. Please make sure all processes\nare terminated then try again. If it still fails, a git process\nmay have crashed in this repository earlier:\nremove the file manually to continue.\n\n/usr/bin/git checkout master --force

How can I "restart" or fix the local git repository of my app service?

Alejandro Peña
  • 131
  • 2
  • 10
  • Does this answer your question? [Git - fatal: Unable to create '/path/my\_project/.git/index.lock': File exists](https://stackoverflow.com/questions/7860751/git-fatal-unable-to-create-path-my-project-git-index-lock-file-exists) – anthony_718 Oct 28 '21 at 18:07

1 Answers1

0

The error message shows that you execute two git commands simultaneously one from the command prompt and one from an IDE.

To fix this issue you can remove the Index.lock file follow below code

For linux/unix/gitbash use the below command:

rm -f .git/index.lock

For Windows use the below Command:

del .git\index.lock

or delete the last commit changes.

rm .git/COMMIT_EDITMSG

If you run by using IDE please close the IDE and run the git command in Cmdr.

Use below command to check the reason why the working tree is locked or not. --reason < string>

With lock or with add --lock, an explanation why the working tree is locked.

Refer here

Delliganesh Sevanesan
  • 4,146
  • 1
  • 5
  • 15
  • Yes this seems to be the answer but I can't find a way to clean the file and run the command from the app service local repository :/ – Alejandro Peña Oct 29 '21 at 22:29