Skip to content

push_to_git_remote

Community Action Reference: Inspected directly from Fastlane core ruby gem definitions.

Supported Platforms: ios, android, mac

Push local changes to the remote branch

Details

Lets you push your local commits to a remote git repo. Useful if you make local changes such as adding a version bump commit (using commit_version_bump) or a git tag (using ‘add_git_tag’) on a CI server, and you want to push those changes back to your canonical/main repo. If this is a new branch, use the set_upstream option to set the remote branch as upstream.

Parameters & Options

Total options available: 9

Key Type Env Variable Default Required Description
local_branch String FL_GIT_PUSH_LOCAL_BRANCH - No The local branch to push from. Defaults to the current branch
remote_branch String FL_GIT_PUSH_REMOTE_BRANCH - No The remote branch to push to. Defaults to the local branch
force Fastlane::Boolean FL_PUSH_GIT_FORCE false Yes Force push to remote
force_with_lease Fastlane::Boolean FL_PUSH_GIT_FORCE_WITH_LEASE false Yes Force push with lease to remote
tags Fastlane::Boolean FL_PUSH_GIT_TAGS true Yes Whether tags are pushed to remote
remote String FL_GIT_PUSH_REMOTE origin Yes The remote to push to
no_verify Fastlane::Boolean FL_GIT_PUSH_USE_NO_VERIFY false Yes Whether or not to use —no-verify
set_upstream Fastlane::Boolean FL_GIT_PUSH_USE_SET_UPSTREAM false Yes Whether or not to use —set-upstream
push_options Array FL_GIT_PUSH_PUSH_OPTION [] Yes Array of strings to be passed using the ‘—push-option’ option

Examples

push_to_git_remote # simple version. Pushes the current branch and all local tags to "origin" remote
push_to_git_remote(
remote: "origin", # optional, default: "origin"
local_branch: "develop", # optional, default is set to current branch
remote_branch: "develop", # optional, default is set to local_branch
force: true, # optional, default: false
force_with_lease: true, # optional, default: false
tags: false, # optional, default: true
no_verify: true, # optional, default: false
set_upstream: true # optional, default: false
)

Source & Upstream