Remotes: fetch, pull, push
Including publish, prune, and force-push-with-lease, each with its preview and its capsule.
Managing remotes is local work
Adding, renaming, re-pointing and removing a remote all edit this repository’s Git configuration and make no network connection at all: the plan states that explicitly, so “add remote” is never mistaken for “contact server”. Ordinary Git remotes are the whole subject here: any host works through your configured SSH or credential helper, and no provider account or token is involved.
| Operation | Risk | Captured first |
|---|---|---|
| Add, rename, set URL | safe | Nothing |
| Remove a remote | caution | Light checkpoint for local refs only |
| Prune remote-tracking refs | caution | Light checkpoint: refs, HEAD, index, patches |
| Delete a branch on the remote | destructive | Nothing a checkpoint can restore |
The previous URL is deliberately not retained
Change or remove a remote and the journal does not keep the old URL, because a remote URL can carry credentials. The plan says the rollback is manual for exactly that reason. Copy the URL somewhere yourself if you might need it.
A remote branch deletion is not recoverable from here
The plan is blunt about it: a local checkpoint cannot restore a branch deleted on a server. Whether you can publish a local branch back over it depends on that host’s protection and retention rules, not on GitAegis.
Fetch
A plain fetch carries the lowest classification the app has, informational, because it only adds objects and moves remote-tracking refs. Your branches and working tree are untouched, and the plan’s rollback line says so rather than inventing a step.
Pruning is a different operation and is labelled as one: caution with a light checkpoint, because it deletes local remote-tracking refs whose branches no longer exist on the server. Deepening a shallow clone, or converting it to a full one, first checks that the repository is actually shallow.
Testing a remote is deliberately the smallest useful probe: git ls-remote --symref <remote> HEAD. It verifies transport and credentials, discovers the default branch where the server reports one, and changes no ref at all.
Fetch, pull and push classify the result of the operation that actually ran; they do not issue a second network probe and pretend it represents the action. GitAegis keeps only a redacted result for the remote: authentication, authorization, host lookup, certificate, network, timeout, rejection or success. The Remote Manager and Doctor can then explain the last failure without keeping raw Git output or a credential-bearing URL.
A failed background fetch retries on a bounded schedule: five minutes at first, doubling up to one hour. A manual Fetch, Pull or Push is never held behind that timer; pressing the action tries immediately and replaces the stored result with what really happened.
Pull
Pull is merge or rebase, chosen per pull, and the choice is passed to Git explicitly (--no-rebase or --rebase) rather than left to ambient configuration. The plan first reads how far ahead and behind you are: if there is nothing to integrate it says the pull is a no-op unless your fetch is stale, and drops the classification accordingly. A rebasing pull is caution and takes a light checkpoint, because it rewrites your local commits.
Push
The plan reads the upstream, counts the commits that would be sent, and shows the upstream ref’s movement with both oids. If the remote holds commits you do not have, the non-fast-forward precondition is marked unsatisfied before you confirm. The rejection is visible in the preview instead of arriving as a wall of Git output.
Publishing a new branch is the same operation with --set-upstream, and the plan states that no upstream is configured yet and that this push will create one.
No checkpoint, and the reason is honest
A push’s checkpoint scope reads “no checkpoint (remote-side operation)”. A capsule protects your local repository; it cannot un-send commits. What the journal does record is the previous remote tip, which is what makes a deliberate restoring push possible later.
Force push, and the lease
Force push is destructive. It runs with a lease, and the lease is not decoration: the remote oid observed while you were authorising the push is embedded in the command, so Git refuses the push if the branch moved after your preview. Before the push is dispatched, execution re-validates that basis against the freshest observable remote state and refuses a stale lease outright rather than letting Git race it.
The tip that is about to be overwritten is preserved as a real ref first:
git update-ref refs/aegis/recover/<branch>-pre-force-push <remote-tip>The plan also lists the commits that are about to be published over, one row per commit with its subject.
What the rehearsal can and cannot tell you
Remote operations are rehearsed with real read-only probes, git ls-remote for the live tip and git push --dry-run --porcelain for the push itself, plus local ancestry computations. The confidence label the preview shows for these is high, not deterministic, and the limitation is printed alongside it: the local result is exact, but the server can change between planning and execution, and its hooks and policies are its own.
Credentials are yours, and prompts are turned off
Git runs with GIT_TERMINAL_PROMPT=0. An authentication failure is a readable error rather than a process hanging invisibly on a prompt you cannot see. Your keychain and your SSH agent do the authenticating; GitAegis stores no token of its own for Git transport.