Create a Git repo or work remotely with a provider - Visual Studio (Windows) (2024)

Edit

Share via

  • Article

Visual Studio makes it easy to create a repo right from the IDE. Repository creation from Visual Studio is optimized for GitHub, but you can work remotely with the Git provider of your choice. Here's how.

Prerequisites

To follow this article, you'll need:

Create a GitHub repo

  1. Open Visual Studio, and then select Create a new project.

    Tip

    If you don't already have a project in Visual Studio to add to a repo, you can quickly create a new C# console app and name it MyNewApp. Visual Studio populates your new app with default "Hello, World!" code.

  2. From the Git menu, select Create Git Repository.

    Create a Git repo or work remotely with a provider - Visual Studio (Windows) (1)

  3. In the Create a Git repository dialog, under the Push to a new remote section, choose GitHub.

  4. In the Create a new GitHub repository section of the Create a Git repository dialog, enter the name of the repo you want to create. (If you haven't yet signed in to your GitHub account, you can do so from this screen, too.)

    Create a Git repo or work remotely with a provider - Visual Studio (Windows) (2)

    Under Initialize a local Git Repository, you can use the .gitignore template option to specify any intentionally untracked files that you want Git to ignore. To learn more about .gitignore, see Ignoring files. And to learn more about licensing, see Licensing a repository.

    Tip

    You can update and change these settings whenever you want to. For detailed instructions, see Git settings in Visual Studio.

  5. After you sign in and enter your repo info, select the Create and Push button to create your repo and add your app.

Open an existing local repository

After you’ve created a repo or cloned one, Visual Studio detects the Git repository and adds it to your list of Local Repositories in the Git menu. From there, you can quickly access and switch between your Git repositories.

Create an Azure DevOps repo

  1. Open Visual Studio, and then select Create a new project.

    Tip

    If you don't already have a project in Visual Studio to add to a repo, you can quickly create a new C# console app and name it MyNewApp. Visual Studio populates your new app with default "Hello, World!" code.

  2. From the Git menu, select Create Git Repository.

  3. In the Create a Git repository dialog, under the Push to a new remote section, choose Azure DevOps.

  4. In the Create a new Azure DevOps repository section, sign in to your Azure account, and then select a project from the Project drop-down list.

  5. Select the Create and Push button to create your repo and add your app.

Related content

Feedback

Was this page helpful?

Feedback

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.

Submit and view feedback for

Create a Git repo or work remotely with a provider - Visual Studio (Windows) (2024)
Top Articles
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6544

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.