Skip to content

Commit 96be6b7

Browse files
authored
Merge pull request #6965 from MicrosoftDocs/master637644710907008903
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 600af8f + ed14524 commit 96be6b7

File tree

5 files changed

+53
-7
lines changed

5 files changed

+53
-7
lines changed

docs/get-started/csharp/tutorial-console.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Tutorial: Create a simple C# console app "
33
description: "Learn how to create a C# console app in Visual Studio, step-by-step."
44
ms.custom: "vs-acquisition, get-started"
5-
ms.date: 02/10/2021
5+
ms.date: 08/12/2021
66
ms.technology: vs-ide-general
77
ms.prod: visual-studio-windows
88
ms.topic: tutorial
@@ -98,7 +98,7 @@ If you don't see the **Console App (.NET Core)** project template, you can get i
9898

9999
![View the 'Create a new project' window](../../get-started/media/vs-2019/create-new-project-dark-theme.png)
100100

101-
1. In the **Create a new project** window, choose **C#** from the Language list. Next, choose **Windows** from the Platform list and **Console** from the project types list.
101+
1. In the **Create a new project** window, choose **C#** from the Language list. Next, choose **Windows** from the Platform list and **Console** from the project types list.
102102

103103
After you apply the language, platform, and project type filters, choose the **Console Application** template, and then choose **Next**.
104104

@@ -107,8 +107,8 @@ If you don't see the **Console App (.NET Core)** project template, you can get i
107107
> [!NOTE]
108108
> If you do not see the **Console Application** template, you can install it from the **Create a new project** window. In the **Not finding what you're looking for?** message, choose the **Install more tools and features** link.
109109
>
110-
> ![The 'Install more tools and features' link from the 'Not finding what you're looking for' message in the 'Create new project' window](../../get-started/media/vs-2019/not-finding-what-looking-for.png)
111-
>
110+
> ![The 'Install more tools and features' link from the 'Not finding what you're looking for' message in the 'Create new project' window](../../get-started/media/vs-2019/not-finding-what-looking-for.png)
111+
>
112112
> Then, in the Visual Studio Installer, choose the **.NET Core cross-platform development** workload.
113113
>
114114
> ![.NET Core cross-platform development workload in the Visual Studio Installer](./media/dot-net-core-xplat-dev-workload.png)
@@ -118,7 +118,7 @@ If you don't see the **Console App (.NET Core)** project template, you can get i
118118
1. In the **Configure your new project** window, type or enter *Calculator* in the **Project name** box. Then, choose **Next**.
119119

120120
:::image type="content" source="./media/vs-2019/csharp-name-your-calculator-project.png" alt-text="in the 'Configure your new project' window, name your project 'Calculator'":::
121-
121+
122122
1. In the **Additional information** window, **.NET Core 3.1** should already be selected for your target framework. If not, select **.NET Core 3.1**. Then, choose **Create**.
123123

124124
:::image type="content" source="./media/vs-2019/csharp-target-framework.png" alt-text="in the 'In the 'Additional information' window, make sure .NET Core 3.1 is selected":::
@@ -355,7 +355,7 @@ Let's get started.
355355

356356
namespace Calculator
357357
{
358-
358+
359359
}
360360
```
361361

@@ -493,7 +493,7 @@ Let's get started.
493493

494494
1. In Visual Studio, press **Ctrl**+**S** to save your app.
495495

496-
1. Close Visual Studio.
496+
[!INCLUDE[../includes/git-source-control.md](../includes/git-source-control.md)]
497497

498498
## Review: code complete
499499

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
ms.date: 08/11/2021
3+
ms.technology: vs-ide-general
4+
ms.custom: vs-get-started
5+
ms.author: tglee
6+
author: TerryGLee
7+
manager: jmartens
8+
ms.topic: include
9+
---
10+
::: moniker range=">=vs-2019"
11+
12+
## Add Git source control
13+
14+
Now that you've created your 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.
15+
16+
> [!TIP]
17+
> Git is the most widely used modern version control system, so whether you're a professional developer or if you're learning how to code, Git can be very useful to you. If you are new to Git, the [https://git-scm.com/](https://git-scm.com/) website is a good place to start. There, you’ll find cheat sheets, a popular online book, and Git Basics videos.
18+
19+
To associate your code with Git, you start by creating a new Git repository where your code is located. Here's how.
20+
21+
1. In the status bar at the bottom-right corner of Visual Studio, select the **Add to Source Control** button, and then select **Git**.
22+
23+
:::image type="content" source="../media/vs-2022/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.":::
24+
25+
1. In the **Create a Git repository** dialog box, sign in to GitHub.
26+
27+
:::image type="content" source="../media/vs-2022/git-create-repo.png" alt-text="Screenshot of the Create a Git Repository dialog window where you can sign in to GitHub.":::
28+
29+
The repository name is auto-populated based on your folder location. By default, your new repository is private, which means you're the only one who can access it.
30+
31+
> [!TIP]
32+
> 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. This also makes your code available to you no matter what computer you're using.
33+
34+
1. Select **Create and Push**.
35+
36+
After you've created your repository, you'll see status details in the status bar.
37+
38+
:::image type="content" source="../media/vs-2022/git-new-private-repo-status-details.png" alt-text="Screenshot of the repo status bar that's below the Solution Explorer pane in Visual Studio.":::
39+
40+
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 chose to view these commits first, too. To do so, click the icon, and then select **View Outgoing/Incoming**.
41+
42+
The second icon with the pencil shows the number of uncommitted changes to your code. You can click this icon to view those changes in the **Git Changes** window.
43+
44+
To learn more about how to use Git with your app, see the [Visual Studio version control documentation](../../version-control/index.yml) page.
45+
46+
::: moniker-end
Loading
Loading
Loading

0 commit comments

Comments
 (0)