Skip to content

Repo sync for protected CLA branch #6965

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/get-started/csharp/tutorial-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "Tutorial: Create a simple C# console app "
description: "Learn how to create a C# console app in Visual Studio, step-by-step."
ms.custom: "vs-acquisition, get-started"
ms.date: 02/10/2021
ms.date: 08/12/2021
ms.technology: vs-ide-general
ms.prod: visual-studio-windows
ms.topic: tutorial
Expand Down Expand Up @@ -98,7 +98,7 @@ If you don't see the **Console App (.NET Core)** project template, you can get i

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

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.
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.

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

Expand All @@ -107,8 +107,8 @@ If you don't see the **Console App (.NET Core)** project template, you can get i
> [!NOTE]
> 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.
>
> ![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)
>
> ![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)
>
> Then, in the Visual Studio Installer, choose the **.NET Core cross-platform development** workload.
>
> ![.NET Core cross-platform development workload in the Visual Studio Installer](./media/dot-net-core-xplat-dev-workload.png)
Expand All @@ -118,7 +118,7 @@ If you don't see the **Console App (.NET Core)** project template, you can get i
1. In the **Configure your new project** window, type or enter *Calculator* in the **Project name** box. Then, choose **Next**.

:::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'":::

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**.

:::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":::
Expand Down Expand Up @@ -355,7 +355,7 @@ Let's get started.

namespace Calculator
{

}
```

Expand Down Expand Up @@ -493,7 +493,7 @@ Let's get started.

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

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

## Review: code complete

Expand Down
46 changes: 46 additions & 0 deletions docs/get-started/includes/git-source-control.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
ms.date: 08/11/2021
ms.technology: vs-ide-general
ms.custom: vs-get-started
ms.author: tglee
author: TerryGLee
manager: jmartens
ms.topic: include
---
::: moniker range=">=vs-2019"

## Add Git source control

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.

> [!TIP]
> 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.

To associate your code with Git, you start by creating a new Git repository where your code is located. Here's how.

1. In the status bar at the bottom-right corner of Visual Studio, select the **Add to Source Control** button, and then select **Git**.

:::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.":::

1. In the **Create a Git repository** dialog box, sign in to GitHub.

:::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.":::

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.

> [!TIP]
> 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.

1. Select **Create and Push**.

After you've created your repository, you'll see status details in the status bar.

:::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.":::

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**.

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.

To learn more about how to use Git with your app, see the [Visual Studio version control documentation](../../version-control/index.yml) page.

::: moniker-end
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.