obsidian-git: [Bug]: pull/push not working with keybase encrypted git

Describe the bug

I set up my vault as a keybase git repo with:

cd <obsidian vault>
git init
git remote add origin keybase://private/XXXX/YYYY
git add -v .
git commit -m "first commit"
git push -u origin main

this worked nicely. Note, that with keybase repo, I can use git commands like with any other provider, i.e. simply git pull origin main, git push origin main, git branch, git rebase, etc., nothing special. Then I installed obsidian git plugin, it can correctly see changes, it can stage changes and commit then (I was able to confirm in the terminal that when clicking on the commit button, git sees that as a proper commit). However, when I try to push or pull, I am getting

git: 'remote-keybase' is not a git command. See 'git --help'.
Screenshot 2022-02-25 at 15 08 08

Now, I feel I know why, but tbh, I don’t understand why 😃 The thing is when git plugin would simply run git push / git pull, this shouldn’t happen. Is there a way to fix this? Thanks! N.

P.S., if it matters, I am on macOS 12.2.1, keybase 5.9.2-20220131221715+a25f15e42b, and obsidian 0.13.23

Relevant errors (if available)

No response

Steps to reproduce

  1. have keybase and obsidian handy
  2. set up Obsidian vault
  3. create keybase encrypted repo in the keybase app or in terminal
  4. cd to repo
  5. git init, git add remote, git add, git commit, git push
  6. install obsidian-git
  7. try to pull / push
  8. error

Expected Behavior

I hoped this would work without any problems, since once the keybase repo is initialized, it works like any other git repo with credentials setup

Addition context

No response

Operating system

macOS

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 19 (1 by maintainers)

Most upvoted comments

Thanks for the input @catherinetcai!. Actually, in my case, /usr/local/bin/ is empty. git-remote-keybase is in my /usr/bin/ folder. Checking my system where the problem could be, I finally realized what the issue is: I installed Obsidian via flatpak. The thing with flatpak Apps is that they are installed in their own sandbox environment. I therefore added the /usr/bin/ path to the filesystem subset of the Obsidian flatpak sandbox. However, that did not work for some reason. I then uninstalled the flatpak version and installed it normally using pacman. That solved the issue!

@GollyTicker I can execute files in /usr/local/bin on my Ubuntu 20.04 machine from within Obsidian. But maybe that’s not always the case?

@jajcayn Not 100% sure about your setup, but… when you specify your custom git binary, I believe you have to provide the absolute path to it, right? I believe the child processes are able to use the custom git binary because they’re always referring to the absolute path /usr/local/bin/git. This will still work just fine even if /usr/local/bin isn’t in your $PATH.

Let me get a fork going with a test and see if that will solve both our problems, and if it does, then I’ll try and propose an actual fix.