Obsidian Git: 'Pull failed (merge): failed: refusing to merge unrelated histories.'

Hi all,

I hope you’re well,

‘Pull failed (merge): failed: refusing to merge unrelated histories.’

I’m trying to figure out this problem that’s started happening. I believe this may be because I’m using Obsidian Sync with iCloud and Obsidian Git.

I’ve read that one workaround may be to use:
git pull origin master --allow-unrelated-histories

Does anyone know how I can enter these type of commands into Obsidian?

Many thanks in advance :slight_smile:

You need to enter this in the terminal. Navigate to your vault (where the .git folder is, don’t go inside) and run it (if that’s what you need to do; I don’t know this command). Git bash on Windows, normal terminal suffices in Linux (you need to install git package).

I recommend downloading and installing GitHub Desktop on your OS and then look out for the Git related prompt.

Git Bash is the command line tool where you will be able to run the command. I don’t know if Obsidian Git can be configured to run specific commands (stopped using it a long time ago).

One can install the Terminal plugin and use all git commands from inside Obsidian. One can set aliases, e.g. gs for git status to make it quick.

On the plus side, one can edit files that are outside of the Obsidian vault as well.

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