Share code with push

Azure Repos | Azure DevOps Server 2019 | TFS 2018 | TFS 2017 | TFS 2015 | VS 2017 | VS 2015

Share changes made in commits and branches using the push command. Push your branches to the remote repository, where Git takes the commits and adds them to an existing branch on the remote or creates a new branch with the same commits as your local branch.

Git makes sure that pushed changes are consistent with the remote branch so others can pull your commits and merge them into their own local copy of the branch. Pushed branches that have finished work are reviewed and merged into the main branch of the your repo through a pull request.

In this tutorial you learn how to:

  • Share your code with push

Video overview

Share your code with push

  1. Open up the Synchronization view in Team Explorer by selecting the Home icon and choosing Sync.


    You can also navigate to the Synchronization view from the Changes view by choosing Sync immediately after making a commit.


  2. Select Push to share your commit with the remote repository.


    If this is your first push to the repository you'll see the following message in place of the outgoing commits list: The current branch does not track a remote branch. Push your changes to a new branch on the origin remote and set the upstream branch. Select Push to push your changes to a new branch on the remote repository and set the upstream branch. The next time you push changes you'll see the list of commits.


    To adjust your Git setup, go to Team Explorer > Settings > Repository Settings and make sure the correct User, Email, Remotes URLs, etc. are being used.

Resolve merge conflicts before pushing

If there are conflicts between your local commits on the commits on the remote branch, you must first resolve these conflicts before you can push your changes. You should pull the changes from others first, resolve the conflicts and commit the changes, then re-attempt the push.

Next steps