ek9_git_push
Reports remote, branch, upstream, upToDate and a summary line, with git's own report under gitReport; outward-facing and not trivially reversible, so confirm intent first.
When to use it
'Publish my commits' - one call, no arguments for the current branch to origin; setUpstream:true on a new branch's first push. The last step of stage, commit, push and outward-facing: confirm intent before calling.
When not to use it
- changes not yet committed - use
ek9_git_commitfirst. - checking ahead/behind before publishing - use
ek9_git_statusorek9_git_fetch. - undoing an already-pushed commit - use
ek9_git_revert, never amend plus force.
Details
Defaults: remote origin, the current branch. force:true is --force-with-lease (refuses to clobber un-fetched upstream work); a bare --force is deliberately not exposed. Refusals name the route: no-remote (add one), rejected (ek9_git_fetch then ek9_git_pull, then push again), timed-out.
Arguments
| Argument | Type | Required | What it is |
|---|---|---|---|
branch | string | Branch to push. Default: the current branch. | |
force | boolean | Replace the remote branch with --force-with-lease (refuses when the remote moved since the last fetch). Default false. | |
remote | string | Remote name. Default origin. | |
setUpstream | boolean | Set the upstream tracking ref (-u) - the first push of a new branch. Default false. |