commitdog sync brings your current branch up to date with the remote and pushes your local commits in one step. It handles unstaged changes automatically by stashing them before the sync and restoring them after. When push or pull fails, commitdog identifies the cause and offers to fix it — switching your remote from HTTPS to SSH, pulling before pushing on a non-fast-forward rejection, or offering to open a PR when pushing to a protected branch.
Usage
What sync does
1
Stash unstaged changes
If your working tree has local modifications, commitdog offers to stash them before syncing:Press Enter or
y to stash. commitdog pops the stash automatically after the sync completes, whether or not the sync succeeded.2
Fetch
commitdog runs a fetch from your primary remote to update remote-tracking references:
3
Pull with rebase
commitdog pulls the current branch using rebase (not merge) to keep history linear:If the branch is already up to date, it prints
already up to date and continues to the push step.4
Push
commitdog pushes the current branch to the remote. If the branch has no upstream tracking reference yet, it sets one automatically:
Auto-recovery scenarios
When fetch, pull, or push fails, commitdog inspects the error message and offers to fix it automatically.HTTPS auth failure → switch remote to SSH
HTTPS auth failure → switch remote to SSH
When GitHub rejects HTTPS password authentication, commitdog detects the error and offers to rewrite your remote URL to SSH and retry:
Non-fast-forward rejection
Non-fast-forward rejection
When the remote has commits you do not have locally, commitdog automatically pulls with rebase and retries the push:Selecting yes pulls the latest changes and retries the push in one step.
Stale remote tag
Stale remote tag
When a release tag already exists on the remote (typically from a partial release run), commitdog detects the conflict, deletes the stale remote tag, and asks you to re-run the command:
Missing upstream (branch not on remote yet)
Missing upstream (branch not on remote yet)
When the current branch has no upstream tracking reference, commitdog pushes with
--set-upstream automatically so subsequent pushes work without extra flags.Push to a protected branch
Push to a protected branch
When the remote rejects a direct push because the branch is protected, commitdog surfaces the error and offers to open the PR flow instead:Selecting yes starts
commitdog pr immediately.