How to clone single branch from one repo to empty new repo?


This Content is from Stack Overflow. Question asked by Darshika Srivastava

How to clone one single branch from repository ‘A’ to other new repo ‘B’ in azure?

I’ve cloned the repo ‘B’ in VS Code, it is empty, so there is one branch only which is main then I opened repo ‘A’, branch I want to clone then copied HTTPS link.

In VS Code terminal I used ‘git clone –single-branch –branch ‘name’ ‘link’.
I am able to run the project locally, but I am not able to push it back to azure.


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?