Gitis a commonly used source code management system. GitHub is a company, website, and desktop application that makes it easier to manage Git.
I used GitHub to store solutions to all the practical exercises at the end of each chapter at the following URL:
https://github.com/markjprice/cs7dotnetcore2
Visual Studio 2017 has built-in support for using Git with GitHub as well as Microsoft's own source code management system named Visual Studio Team Services (VSTS).
In Visual Studio 2017, navigate to View
| Team Explorer
, as shown in the following screenshot:
Although it is a good idea to sign up with an online source code management system provider, you can clone a GitHub repository without signing up for an account.
In the Team Explorer
window, expand Local Git Repositories
, click on the Clone
menu, and then enter the following URL of a Git repository to clone it:
https://github.com/markjprice/cs7dotnetcore2.git
Enter a path for the cloned Git repository:
C:\Code\Repos\cs7dotnetcore2
Click on the Clone
button, as shown in the following screenshot:
Wait for the Git repository to clone locally.
You will now have a local copy of the complete solutions to all of the hands-on practice exercises for this book.
Visual Studio Code has support for Git, but it will use your OS's Git installation, so you must install Git 2.0 or later first before you get these features. You can install Git from the following link:
Note
If you like to use a GUI, you can download GitHub Desktop from the following link:https://desktop.github.com
Launch Terminal
, and enter the following command to check your configuration:
git config --list
The output should include your username and email address, because these will be used with every commit that you make:
...other congfiguration... user.name=Mark J. Price [email protected]
If your username and email has not been set, to set your username and email, enter the following commands, using your own name and email, not mine:
git config --global user.name "Mark J. Price" git config --global user.email [email protected]
You can check an individual configuration setting like this:
git config user.name
Launch Visual Studio Code, and open the Code
folder.
Navigate toView
| Integrated Terminal
or press Ctrl + `, and enter the following commands:
mkdir Repos cd Repos git clone https://github.com/markjprice/cs7dotnetcore2.git
Cloning all of the solutions for all of the chapters to your local drive will take a minute, as shown in the following screenshot:
Note
For more information about source code version control with Visual Studio Code, visit the following link:https://code.visualstudio.com/Docs/editor/versioncontrol