Get the latest version and check in code
To avoid conflicts and ensure that the code is developed correctly, checking the source is mandatory.
The Source Control Explorer is your go-to view for all the code and objects that have been checked into source control.
To open the Source Control Explorer, follow these steps:
To make sure that you are looking at the most recent checked-in version of objects in the Source Control Explorer, right-click on the objects and select Get Latest Version. Alternatively, you can do this at the folder level to get all the updates.
You should always get the latest files from the branch that you are working in before checking in new changes. If someone else has also pushed changes to the file that you were editing, this will give you an opportunity to reconcile your changes with theirs and make sure that all the features are working before the resulting changes are checked in.
To perform the check-in process, follow these steps:
Merging code and resolving code conflicts
When Visual Studio encounters a merge conflict, it will attempt to resolve it automatically. Any such resolution is in the output log. If any conflicts fail to resolve automatically, they will appear in a new window that prompts you to tell Visual Studio what it should do for each conflicting file.
The Resolve Conflicts window gives you the following options for each file:
You will not be able to check in a changeset until there are no unresolved merge conflicts, so mastering these tools is key to your success as a member of a development team.
Roll back changes in Visual Studio
In Visual Studio, this is simple to accomplish from the Source Control Explorer. Right-click the branch that you want to roll back changes from and select View History. This selection opens a new window, where you can see all the changesets that have been checked in to this branch. To roll back a changeset, right-click the changeset and select Rollback Entire Changeset.