ek9_git_fetch
Reports updated, upstream, behind and ahead, a summary line and a nextStep when behind; git's own report under gitReport.
When to use it
'Is there anything new upstream?' - one call, no arguments; updates remote-tracking refs only and reports behind/ahead without touching the working tree. The safe pre-flight before ek9_git_pull.
When not to use it
- integrating the upstream commits into the branch - use
ek9_git_pull. - the local working-tree state (no network) - use
ek9_git_status. - history already present locally - use
ek9_git_log.
Details
Safe by construction: fetch only advances remote-tracking refs (origin/main, ...) so it cannot conflict or leave a half-done tree. updated is true when git reported ref updates; upstream/behind/ahead appear only when the current branch has an upstream and match ek9_git_status exactly; gitReport is git's own report. Refusals: no-remote (add one first), timed-out.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
allRemotes | boolean | Fetch every remote (--all) instead of one. Default false. | |
prune | boolean | Drop remote-tracking refs deleted on the remote (--prune). Default false. | |
remote | string | Remote name. Default origin. |