Git - Push


push will send branch to the remote creating remote branch


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:

  • Take my branchName local branch and push it to update the remote’s branchName branch.”


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

git push -u origin stable


  • origin is the name of a remote
  • stable is the name of a branch
  • -u set the remote branch as a tracking branch


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

Powered by ComboStrap