My configuration was BitBucket and linked to Azure App Service via the Deployment Center and it auto pulls from my Master branch.
One fine day, the deployment failed and threw me this error.
I am not sure what caused the locked but here’s the solution but upon inspection of the logs, i received this.
Fatal: Unable to create ‘D:/home/site/repository/.git/index.lock’: File exists.Another git process seems to be running in this repository, e.g. an editor opened by ‘git commit’. Please make sure all processes are terminated then try again. If it still fails, a git processmay have crashed in this repository earlier: remove the file manually to continue. D:\Program Files\Git\cmd\git.exe checkout master –force
Go into your App Service > Console > Navigate to the folder and use rm command to remove it.
cd D:\home\site\repository\.git
rm index.lock
Thereafter, go back to your deployment center and click on Sync and it will work magically.