Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Git Repo with New Project in Visual Studio 2019

In Visual Studio 2017, there used to be an option when creating a New Project to "Make a new Git Repository with Solution", or something similar.

I can't seem to find the option in Visual Studio 2019. Has it been removed? I was thinking maybe it requires an extension?

like image 629
Moffen Avatar asked May 07 '19 02:05

Moffen


People also ask

How do I create a new repository in VS?

In Visual Studio, you can quickly create a new git repo from the file menu. Just navigate from File > New and select “Repository“. When you select the new repository option, Visual Studio will bring up the git source control connection tool with the new repository option enable.

How do I create a new Project in repository?

In the Project area in the web portal, select Code, then select the drop-down next to the current repo name and choose New Repository. In the Create a new repository dialog, verify that Git is the repo type and enter a name for your new repo.

How to create a new Git repository in Visual Studio?

Create new git repository while creating new project in Visual Studio Start a new instance of Visual Studio Launch the New Project Dialog Window by navigating from File -> New -> Project Select the Project Template and provide all other required information for project creation Select the “Create new Git Repository” checkbox Click on OK

How do I open a Visual Studio project from a repo?

Visual Studio opens the project from the repo. If you have a solution file available, it will appear in the “Solutions and Folders” fly-out menu. Choose it, and Visual Studio opens your solution.

How do I open a GitHub project in Visual Studio 2019?

Open a project from a GitHub repo. Open Visual Studio 2019. On the start window, choose Clone or check out code. Enter or type the repository location, and then choose Clone. Visual Studio opens the project from the repo. If you have a solution file available, it will appear in the “Solutions and Folders” fly-out menu.

How do I create a Git repo in Azure DevOps?

This step creates a new project in your Azure DevOps account with the same name that you selected for the repo. To create the repo in an existing project, select Advanced next to the Repository name, and then choose a project. Your code is now in a Azure Repos Git repo.


1 Answers

Yes, it's strange, isn't it... not being given the option to save your code to git, when you're creating a new project.

The solution is simple enough though - just click on the "Add to Source Control" item at the bottom-right of the Visual Studio 2019 window.

enter image description here

From there, you are given the option to "Push to Azure DevOps Services", or to a Remote Repository.

What is really cool about this first option is that this sets up everything you'll need in the Azure DevOps site, ready to add Continuous Integration, Pipelines, etc.

And, obviously, you can see the files from your new VS2019 in the "Repos" section of this website.

like image 70
Mike Gledhill Avatar answered Nov 02 '22 18:11

Mike Gledhill