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.
I’m not sure is there any shortcut to do that, but you always can push specific branch to another remote that you’ve just cloned.
Firstly you have to add the azure remote that you mention by this command
git remote add [name of the remote] [git address of the remote]
Push specific branch to that remote by this command
git push -u [name of the remote] [name of the branch you wanna push]
git remote add azure https://azure.git
git push -u newbranch azure