Table of Contents

Git - Push

About

push will send branch to the remote creating remote branch

Syntax

git push <remote> <branch>

# or
git push origin localBranchName:remoteBranchName

Git automatically expands the branchName out to refs/heads/branchName:refs/heads/branchName, which means:

Example

Push a local branch to a remote, creating also the remote branch

git push -u origin stable

where:

output:

* [new branch]      stable -> stable
Branch 'stable' set up to track remote branch 'stable' from 'origin'.