Push

wrgl push

Updates remote refs using local refs, sending objects necessary to complete the given refs.

wrgl push { REPOSITORY [REFSPEC...] | --all } [flags]

If REPOSITORY isn't specified then "origin" is assumed. If REFSPEC aren't specified then they are read from remote.<remote>.push config (unless --mirror flag is specified). To learn more about refspec, see the next section.

Flags

--all

push all branches that have upstream configured.

-f, --force

force update remote branch in certain conditions.

-h, --help

help for push

--mirror

instead of naming each ref to push, specifies that all refs (which includes but not limited to refs/heads/ and refs/remotes/) be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end. This is the default if the configuration option remote.<remote>.mirror is set.

--no-progress

don't display progress bar

-u, --set-upstream

for every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less `wrgl pull`.

Inherited flags

--badger-log

set Badger log level, valid options are "error", "warning", "debug", and "info" (defaults to "error")

--cpuprofile

write cpu profile to file

--debug

print debug logs to stdout

--debug-file

print debug logs to the given file instead

--heapprofile

write heap profile to file

--wrgl-dir

parent directory of repo, default to current working directory.

Examples

# push changes of two branches to origin
wrgl push origin refs/heads/main:main refs/heads/beta:beta

# push to main branch (destination ref is assumed to be the same as source ref)
wrgl push origin refs/heads/main:

# push and set branch upstream
wrgl push origin refs/heads/main:main --set-upstream

# remove branch main
wrgl push origin :refs/heads/main

# force update branch (non-fast-forward)
wrgl push origin +refs/heads/beta:beta

# push to my-repo reading from remote.my-repo.push
wrgl push my-repo

# force update my-repo
wrgl push my-repo --force

# turn the remote into a mirror of local repository
wrgl push my-mirror-repo --mirror

How refspecs are interpreted

Each refspec has the form <local ref>:<remote ref>. For each refspec, wrgl push will try to update remote ref to the commit pointed at by the local ref, pushing objects as needed.

If remote ref is omitted, search remote.<remote>.push config for an entry with the same local ref and read remote ref from that. If that fails, remote ref is assumed to be the same as local ref.

If remote ref is specified but not the local ref (e.g. :refs/heads/main) then the remote ref will be removed. If the remote set receive.denyDeletes to true then this operation will fail.

If the remote ref already exist and it is an ancestor of the commit at the local ref, then the update is called a "fast-forward". If remote ref exist but its commit is not an ancestor of local ref then the update is called "non-fast-forward". Non-fast-forward updates are denied by default. Unless the flag --force is specified or if the refspec is prefixed with a +, then the remote ref is force-updated. However, if the remote set receive.denyNonFastForwards to true then non-fast-forward updates cannot be forced.