I’m having a really weird lock file issue. What will happen is that I will do say a pull request and there will be no lock file in the .git folder, then a lock file will appear for a split second disappear and then reappear and disappear again then I will get a lock file error, “A lock file already exists in the repository, which blocks this operation from completing.” Sometime a restart of the pc will fix the issue for a little while but it originated in source control and is now happening in github. anyone have this issue before?
I get the impression you’re working under Windows OS, is this correct?
You shouldn’t really fiddle with the
.git/ folder’s contents, since Git automatically handles it. Example, if you keep open in an editor (or another application) one of the files from the
.git/ folder’s, and the editor/app you’re using claims exclusive rights over read/write operations on that file, then Git will be unable to correctly edit, delete or create those files.
Try closing any application with which you have opened files from the
.git/ folder (even if you closed the file, the app might still have an open handle on that file), and try the Git operations you want to do, and if you get an error paste the command and its error response from the Bash into this thread, so we can get a clear picture of what the error is reporting.
Beware that even by keeping open a File Explorer instance which has handled a file from the
.git/ folder might interfere with Git’s normal operations. As I mentioned, that folder should be left alone, unless you really need to do manual operations therein, and on the conditions that you really know what you’re doing.