Pushing code to a Git repository
The application development is done. Let's save our code to our Git repository so we can access the code from anywhere:
- In Visual Studio, in the bottom-right corner, click on
Add to Source Control
and then selectGit
:

- Click on
Connect
|Settings
:

- Click on
Global Settings
:

- Enter your GitHub account username and email and click
Update
: - Click on the up arrow icon (push icon) at the bottom of the Team Explorer.
- Then, click on
Publish Git Repo
underPush to Remote Repository
. - Notice that it says there is no remote repository configured for this local repository. That is because we haven't connected our remote GitHub repository to our local project:

Log in to your GitHub account and create an empty Git repository for your project, as we learned in Chapter 2, Working with Code Repository Systems, and copy that URL to the textbox shown in the following screenshot:

- After clicking on
Publish
, a new window will open asking for your GitHub credentials:

- Enter your GitHub credentials...