Skip to main content
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.
When GitHub rejects HTTPS password authentication, commitdog detects the error and offers to rewrite your remote URL to SSH and retry:
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.
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:
When the current branch has no upstream tracking reference, commitdog pushes with --set-upstream automatically so subsequent pushes work without extra flags.
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.