Obsidian Git plugin causing error in git

I get the following output when I try to commit my changes to my obsidian git repo, I think the obsidian git plugin is causing some half done git actions causing the repo to fail on committing. For reference, I get the below output in my terminal

git add .
fatal: Unable to create '/X/obsidian_vault/.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 process
may have crashed in this repository earlier:
remove the file manually to continue.

Has anyone came across something similar and if so how did you fix it? Thanks in advance

1 Like

Same problem here, just happened to me today. I am not sure how to troubleshoot this so I am also waiting for an answer

@ghadir I am making sure to ping both of you because I know how to solve this.

If this comes up you want to navigate to your vault folder. It is just a folder with files in it on your computer.

Wherever it is, navigate there. Once there find the .git directory. If you don’t see it and you are on MacOS, you may need to press CMD + SHIFT + . (command shift period) as this will show hidden folders/files.

Once you see it, navigate inside.

Inside you should see this index.lock file.

Delete it.

Now try the command again in Obsidian Git. Should work.

Also, I would report this on the Obsidian Git Github as that is where the plugin tracks issues. Just make sure there isn’t already an issue open for this already.

2 Likes

Thank you lot! I actually just came back to post the solution because I found it: Another Git process seems to be running in this repository - Stack Overflow
But you saved me the effort of explaining it :slight_smile:

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.