denolehov / obsidian-git

Backup your Obsidian.md vault with git
MIT License
6.15k stars 252 forks source link

[Bug]: "ambiguous argument" - successful commit but unable to push to remote through obsidian. #612

Closed dancooper37 closed 9 months ago

dancooper37 commented 9 months ago

Describe the bug

Reconfiguring Obsidian + Obsidian Git after resetting PC.

Successfully commits, but throws below error when trying to push automtically. I can successfully push the commit through git bash without issue, authentication is not the issue.

Reintialised the local repo, reset head. Using HTTPS authentication.

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

Uncaught (in promise) Error: fatal: ambiguous argument 'null': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

    at Object.action (plugin:obsidian-git:10679:25)
    at PluginStore.exec (plugin:obsidian-git:10704:25)
    at eval (plugin:obsidian-git:8499:43)
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (plugin:obsidian-git:8497:16)
    at GitExecutorChain.eval (plugin:obsidian-git:8481:44)
    at Generator.next (<anonymous>)
    at fulfilled (plugin:obsidian-git:7333:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps to reproduce

New install of obsidian and git. Clone remote repo to local machine through git bash. Authenticate using HTTPS in git bash, using personal access token. Reinitialise local repo, create test file in obsidian. Use backup hotkey in obsidian to commit and push.

Expected Behavior

"Backup" should commit and push changes to remote. Commit is successful, and be manually pushed from git bhas, but is not performed automatically, instead throwing an error into the obsidian console.

Addition context

No response

Operating system

Windows

Installation Method

None

Plugin version

1.26.1

dancooper37 commented 9 months ago

Completely reinstalled git, and took deleting and re-cloning the repo from remote three times to fix but it works now. Don't know what the error means still, but it works.