web analytics

Working With Azure DevOps

Options
@2020-10-31 20:04:21

Update branches with Sync

Sync is a combined operation of pulling remote changes and then pushing local ones. This operation synchronizes the commits on the local and remote branch.

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

Synchronization view, Visual Studio.

2.In Synchronization, select Sync.

In Synchronization, select Sync.

3.Review the confirmation message when the sync operation completes.

Synch operation complete

@2020-10-31 20:18:30

Update your branch with the latest changes from master

When working in a branch, you may want to incorporate the latest changes from the master branch into your branch. There are two approaches you can use: rebase or merge.

  • Rebase takes the changes made in the commits in your current branch and replays them on the history of another branch. Rebasing rewrites the commit history of your current branch. The history starts from the most recent commit in the target branch of the rebase.
  • Merge merges the changes from the source branch to the target branch using a merge commit, which becomes part of the commit history.

merge

To merge the latest changes from the master branch to your branch:

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

2.Check out your target branch. Right-click the target branch, and choose Merge From.

Merge from

3.Specify a Merge from branch, which is master in this example, and then select Merge.

Merge from master

If there are any merge conflicts, Team Explorer tells you now. Resolve the merge commits before the next step.

4.Enter a commit message and select Commit Staged.

Commit merge from master

5.When you're ready to push your local commits, including your new merge commit, to the remote server, choose Push from the Synchronization view.

Push

Rebase

In Team Explorer, go to the Branches view. Click Rebase. You'll see a prompt to rebase the changes from your current branch, and then a drop-down to specify which branch the changes in the current branch should be replayed on top of. If there is a conflict, resolve it just like you resolve merge conflicts in Visual Studio.

Rebasing with Git in Visual Studio

@2020-11-03 08:51:59

Stashing the Changes

Stashing helps you to save uncompleted work so that you can reapply it to your local repo when needed. Stash works the same way a shelveset in TFVC works. 

Prerequisites: You need Visual Studio 2019(not in VS2017 or before) to use stash functionality.

You have completed all the lessons in this chapter and have the code available in the Azure Git repository and opened a local repo in VS Code and in Visual Studio.

In Visual Studio, open the solution from the local repo and make a code change.

Then click the changes in Team Explorer; you will see the stash options on the commit changes page.

@2020-11-03 08:56:01

Unset Upstream Branch

In the event that you want to stop tracking an upstream branch, go to the Branches page, right click on a local branch, and unset its upstream:

 team-explorer-branches

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com