From the course: Visual Studio 2019 Essential Training

Working with source control in Visual Studio - Visual Studio Tutorial

From the course: Visual Studio 2019 Essential Training

Start my 1-month free trial

Working with source control in Visual Studio

- [Instructor] Source control is a must for team development. It ensures that each developer has a safe place to experiment with changes without impacting the other team members' work. The changes can be merged back into the main source tree at any time by any team member. All the code history is safely stored in the repository, which means any team member can work on bug fixes in older code versions. In this video we'll explore how Visual Studio integrates with various source control systems. The first decision you make in Visual Studio is which source control system to use for a given project. By default, Visual Studio has two source control plugins installed, Git and Visual Studio Team Foundation Server. There are other plugins available, so you can integrate other systems into Visual Studio. This is useful if your team works with other visual control systems like SVN. In this example, I opened the Manage Extensions dialog and searched for the VisualSVN plugin. After clicking the Download button and restarted Visual Studio, our choices for plugins now includes the VisualSVN provider. Choosing a plugin configures Visual Studio to work with repositories for that version control provider. On the left is a project using the Git plugin on the right is a project using SVN. You can see some differences on the solution explorer context menu. On the left menu are Git commands like Undo, Commit, View History, and Blame. On the right are SVN commands like Show Differences, Revert Changes, Update, and Commit. Choose your plugin and then use it to interact with your repository. All the version control actions like checkout code, commit code changes, review changes before merging with a dif tool are available from within Visual Studio. In this course, I'm using Git as the source control provider. The source repo is hosted in the cloud. You'll find it on GitHub. Details coming later in the chapter. In this short chapter, we'll look at an introduction to Git, we'll take an overview of distributed source control systems, we'll see how to use Git within Visual Studio, and how to work with remote repositories kept on GitHub, and then we'll look at how to use the course files on GitHub for the examples. For a more extensive look at source control and Visual Studio, I recommend this course on LinkedIn Learning, Visual Studio Essential Training, protecting your code base with source control providers. Also there are plenty of other courses that look at the details of Git.

Contents