bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/Git/Git and {{title}}
Git•Git and {{title}}

Git Push Branch to {{title}}

Change Platform:

GitHub

Bitbucket

GitLab

Push Branch to

This chapter explains how to push a branch from your local computer to .

Push a Branch to

Let's create a new local branch, make a change, and push it to .

Example git checkout -b update-readme

Switched to a new branch 'update-readme'

Edit a file, then check the status:

Example git status

Add and commit your changes:

Example git add README.md git commit -m "Update readme for "

Push your branch to :

Example git push origin update-readme

Push and Set Upstream

Use this if your branch doesn't exist on yet, and you want to track it:

Example git push --set-upstream origin update-readme

Force Push

Warning:

This overwrites the branch on with your local changes. Only use if you understand the risks.

Example git push --force origin update-readme

Delete Remote Branch

Remove a branch from :

Example git push origin --delete update-readme

Push All Branches

Push all your local branches to :

Example git push --all origin

Push Tags

Push all your tags to :

Example git push --tags

Troubleshooting

Rejected push (non-fast-forward):

Someone else pushed changes before you. Run git pull --rebase first, then try again.

Authentication failed:

Make sure you are logged in and have permission to push to the repository.

Remote branch not found:

Formula

Double - check the branch name and spelling.

Previous

Git Pull Branch from {{title}}

Next

Git GitHub Flow