You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/get-started/tutorial-console-cpp.md
+36-38Lines changed: 36 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -369,9 +369,43 @@ Let's handle division by zero more gracefully, so a user can understand the prob
369
369
370
370
- If it's still running, close the console window for the calculator app.
371
371
372
+
## Add Git source control
373
+
374
+
Now that you've created an app, you might want to add it to a Git repository. We've got you covered. Visual Studio makes that process easy with Git tools you can use directly from the IDE.
375
+
376
+
> [!TIP]
377
+
> Git is the most widely used modern version control system, so whether you're a professional developer or you're learning how to code, Git can be very useful. If you're new to Git, the [https://git-scm.com/](https://git-scm.com/) website is a good place to start. There, you can find cheat sheets, a popular online book, and Git Basics videos.
378
+
379
+
To associate your code with Git, you start by creating a new Git repository where your code is located. Here's how:
380
+
381
+
1. In the status bar at the bottom-right corner of Visual Studio, select **Add to Source Control**, and then select **Git**.
382
+
383
+
:::image type="content" source="media/git-add-source-control.png" alt-text="Screenshot of the Git source control buttons below the Solution Explorer pane, with the Add to Source Control button highlighted.":::
384
+
385
+
1. In the **Create a Git repository** dialog box, sign in to GitHub.
386
+
387
+
:::image type="content" source="media/git-create-repo-cpp.png" alt-text="Screenshot of the Create a Git Repository dialog window where you can sign in to GitHub.":::
388
+
389
+
The repository name auto-populates based on your folder location. By default, your new repository is private, which means you're the only one who can access it.
390
+
391
+
> [!TIP]
392
+
> Whether your repository is public or private, it's best to have a remote backup of your code stored securely on GitHub. Even if you aren't working with a team, a remote repository makes your code available to you from any computer.
393
+
394
+
1. Select **Create and Push**.
395
+
396
+
After you create your repository, you see status details in the status bar.
397
+
398
+
:::image type="content" source="media/git-new-private-repo-status-details-cpp.png" alt-text="Screenshot of the repo status bar that's below the Solution Explorer pane in Visual Studio.":::
399
+
400
+
The first icon with the arrows shows how many outgoing/incoming commits are in your current branch. You can use this icon to pull any incoming commits or push any outgoing commits. You can also choose to view these commits first. To do so, select the icon, and then select **View Outgoing/Incoming**.
401
+
402
+
The second icon with the pencil shows the number of uncommitted changes to your code. You can select this icon to view those changes in the **Git Changes** window.
403
+
404
+
To learn more about how to use Git with your app, see the [Visual Studio version control documentation](/visualstudio/version-control/index.yml).
405
+
372
406
## The finished app
373
407
374
-
Congratulations! You've completed the code for the calculator app, and built and debugged it in Visual Studio.
408
+
Congratulations! You've completed the code for the calculator app, built and debugged it, and added it to a repo, all in Visual Studio.
375
409
376
410
## Next steps
377
411
@@ -740,43 +774,7 @@ Let's handle division by zero more gracefully, so a user can understand the prob
740
774
741
775
- If it's still running, close the console window for the calculator app.
742
776
743
-
## Add Git source control
744
-
745
-
Now that you've created an app, you might want to add it to a Git repository. We've got you covered. Visual Studio makes that process easy with Git tools you can use directly from the IDE.
746
-
747
-
> [!TIP]
748
-
> Git is the most widely used modern version control system, so whether you're a professional developer or you're learning how to code, Git can be very useful. If you're new to Git, the [https://git-scm.com/](https://git-scm.com/) website is a good place to start. There, you can find cheat sheets, a popular online book, and Git Basics videos.
749
-
750
-
To associate your code with Git, you start by creating a new Git repository where your code is located. Here's how:
751
-
752
-
1. In the status bar at the bottom-right corner of Visual Studio, select **Add to Source Control**, and then select **Git**.
753
-
754
-
:::image type="content" source="media/git-add-source-control.png" alt-text="Screenshot of the Git source control buttons below the Solution Explorer pane, with the Add to Source Control button highlighted.":::
755
-
756
-
1. In the **Create a Git repository** dialog box, sign in to GitHub.
757
-
758
-
:::image type="content" source="media/git-create-repo-cpp.png" alt-text="Screenshot of the Create a Git Repository dialog window where you can sign in to GitHub.":::
759
-
760
-
The repository name auto-populates based on your folder location. By default, your new repository is private, which means you're the only one who can access it.
761
-
762
-
> [!TIP]
763
-
> Whether your repository is public or private, it's best to have a remote backup of your code stored securely on GitHub. Even if you aren't working with a team, a remote repository makes your code available to you from any computer.
764
-
765
-
1. Select **Create and Push**.
766
-
767
-
After you create your repository, you see status details in the status bar.
768
-
769
-
:::image type="content" source="media/git-new-private-repo-status-details-cpp.png" alt-text="Screenshot of the repo status bar that's below the Solution Explorer pane in Visual Studio.":::
770
-
771
-
The first icon with the arrows shows how many outgoing/incoming commits are in your current branch. You can use this icon to pull any incoming commits or push any outgoing commits. You can also choose to view these commits first. To do so, select the icon, and then select **View Outgoing/Incoming**.
772
-
773
-
The second icon with the pencil shows the number of uncommitted changes to your code. You can select this icon to view those changes in the **Git Changes** window.
774
-
775
-
To learn more about how to use Git with your app, see the [Visual Studio version control documentation](/visualstudio/version-control/index.yml).
776
-
777
-
## The finished app
778
-
779
-
Congratulations! You've completed the code for the calculator app, built and debugged it, and added it to a repo, all in Visual Studio.
777
+
Congratulations! You've completed the code for the calculator app, and built and debugged it in Visual Studio.
0 commit comments