web analytics

Working With Azure DevOps

Options
@2020-10-31 17:19:08

Share your changes

When you're ready to share your changes with the team, push those changes so that others can reach them. You can only push changes after you add commits to a branch.

Once you push the changes, you can create a pull request. A pull request lets others know you'd like to have the changes reviewed. After approval, a pull request adds your changes to the master branch of the code.

1.In Team Explorer, select Home and then choose Sync to open Synchronization.

Synchronization

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

Choose Sync immediately after making a commit.

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

Push

If this push is your first to the repository, you'll see the following message: 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.

3.Create a pull request so that others can review your changes. Open Pull Requests in Team Explorer by selecting Home and choosing Pull Requests.

Pull Requests

4.In Pull Requests, you can view pull requests opened by you, assigned to you, and you can create new pull requests. Select New Pull Request to open a web browser where you can create the new pull request in the Azure Repos web portal.

Select New Pull Request.

5.Verify your branches. In this example, we want to merge the commits from the ReadMeFix branch into the master branch. Enter a title and optional description, specify any reviewers, optionally associate any work items, and then select Create.

Create a Pull Request in the web portal

@2020-10-31 17:23:48

Sync with others

To keep your code up to date, pull commits made by others and merge them into your branch. Git is very good about merging multiple changes even in the same file, but sometimes you might have to resolve a merge conflict. It's a good idea to pull your branches regularly to keep them up to date with the changes from others. Pulling often makes sure that your feature branches from your main branch are using the latest version of the code.

1.In Team Explorer, select Home and choose Sync to open Synchronization.

Synchronization with others.

2.You can download the latest changes to your branch using the Pull link. There are two Pull links, one near the top and one in the Incoming Commits section. You can use either because they both do the same thing.

Download changes to your local repo

@2020-10-31 19:58:23

Update the code in your local repo with the changes from other members of your team using the following commands:

  • fetch , which downloads the changes from your remote repo but doesn't apply them to your code.
  • merge , which applies changes taken from fetch to a branch on your local repo.
  • pull , which is a combined command that does a fetch and then a merge.
@2020-10-31 20:00:04

Download changes with fetch

You download changes to your local branch from the remote through fetchFetch asks the remote repo for all commits and new branches that others have pushed but you don't have and downloads them into your repo, creating local branches as needed.

Fetch doesn't merge any changes into your local branches. It only downloads the new commits for your review.

Visual Studio uses the Sync view in Team Explorer to fetch changes. Changes downloaded by fetch aren't applied until you Pull or Sync the changes.

1.In Team Explorer, select the Home button and choose Sync.

Synchronization view

2.In Synchronization, select Fetch to update the incoming commits list.

Screenshot that shows selecting Fetch.

There are two Fetch links, one near the top and one in the Incoming Commits section. You can use either one.

3.Review the results of the fetch operation in under Incoming Commits.

Incoming commits

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com