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.
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.
- Get the address of the main branch from the repo. Forget about branches at this point.
- Tell VS that you want to clone an existing repo.
- 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.
- Observe VS complete operation. (If credentials are already correct.)
- Switch to desired branch – in this example it’s dev.
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