Skip to main content
  1. Learn center
  2. Software Development
  3. Guides
  4. Git tutorial
  5. Git collaboration
  6. Remote branches
  7. Pushing branches to remote
GuidesSoftware DevelopmentBacklog
Git

Project and code management together.

Pushing branches to remote

All of your commits are available until you push your local branch to the remote repository. In other words, you can work on your local branch at your own pace without affecting other team members.

When you push your local branch to remote, Git will do a fast-forward merge to the destination repository.

However, if the push results in a non-fast-forward merge, Git will decline your push to prevent you from overwriting previous commits. In that case, you must pull the latest remote changes and push again.

Diagram displaying git push command.
Use git push to add your local changes to the remote repository.

You must not overwrite or change commits that have already been committed to the remote repository. Doing so will cause other team members’ local repositories to diverge from the remote repository.

Subscribe to our newsletter

Learn with Nulab to bring your best ideas to life