Updated Edit
On this page
push refs to remote with pre-pre-push hooks and automatic retry
#safegit push
push refs to remote with pre-pre-push hooks and automatic retry
Effect: mutating
#Flags
| Name | Short | Type | Presence | Env | Description |
|---|---|---|---|---|---|
--pre-push-hook, --no-pre-push-hook | bool | optional | run pre-pre-push hook scripts before pushing to remote; omitted means the hooks run. Under --dry-run they are never run whatever this says -- a hook is an arbitrary script, so running one is a mutation a preview may not perform -- and the preview says so on stderr and in the payload's pre_pre_push_hooks_skipped member. Only EXECUTION is skipped, though: DISCOVERY runs in a preview too, because it reads the filesystem and mutates nothing, and its two refusals (exit 24 for hooks left in the pre-migration .git/hooks location, exit 25 for a discovered hook without its execute bit, in either store) are verdicts about the checkout that hold whether or not anything is pushed -- a preview that skipped discovery would report success for a push that could only ever exit 24 or 25. Passing --no-pre-push-hook skips discovery along with execution | ||
--force-with-lease, --no-force-with-lease | bool | optional | force push, pinning each ref to the SHA safegit just observed on the remote (--force-with-lease= | ||
--refs | str | required | which refs to push Values: head (push only the current HEAD branch to the remote, ignoring other refs), branches (push all local branches to the remote, ignoring tags and other refs), tags (push all local tags to the remote without pushing any branches), both (push all local branches and all tags to the remote in one operation). |
#Arguments
| Name | Type | Presence | Description |
|---|---|---|---|
remote | str | optional | name of the remote repository to push to (defaults to origin) |
#Grants
| Kind | Name | Reason |
|---|---|---|
| proc_mutate | push | publishing local refs to a remote is what this command is for |
| proc_mutate | force-push | --force-with-lease overwrites the remote ref, discarding whatever the lease expectation did not cover |