How to clone a specific branch from new git Visual Studio 2019 (not from command)?

Issue

How to clone a specific branch from git Visual Studio 2019? I know how to do it in command but not sure how to di it using new git in Visual Studio 2019.

enter image description here

All I can do is to clone the master first and choose the specific branch from there.

Solution

There seems to be only one route to get a branch via VS. It cannot be done directly but there is a simple path.

  1. Get the address of the main branch from the repo. Forget about branches at this point.

Get master address via clone option.

  1. Tell VS that you want to clone an existing repo.

Clone via VS

  1. Give VS the git repo address – it’s in the paste buffer so just paste it into the repo location field. Set repo destination. Start clone operation.

Set VS repo info

  1. Observe VS complete operation. (If credentials are already correct.)

VS clone of master is successful.

  1. Switch to desired branch – in this example it’s dev.

Switch to desired repo.

That’s it. Hope that helps.

Answered By – Scott Howard

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published