Reputation: 11599
I cloned a GitHub project called nopCommerce locally. I also branched the repo with the command
git checkout -b mybranch
I want to publish this branch mybranch to Visual Studio Services. How can I do that?
This is how my Team Services look like in the Visual Studio 2015.
Upvotes: 1
Views: 4611
Reputation: 38106
You can publish a local github repo to VSTS by below steps:
mybranch
in vs, branches -> new local branch from -> create branch.Upvotes: 4
Reputation: 1999
If you already have a local Git repository on your disk, you do not really need nor the GitHub extension, nor creating a new branch.
You only need to :
1) get the URL of an empty Git repository
First retrieve the URL of an empty existing repository, or create a new empty repository using the VSTS web interface:
Retrieve the HTTPS URL to that repository on the Files tab of the repository: it should be of the form
https://YOURACCOUNT.visualstudio.com/DefaultCollection/TEAMPROJECTNAME/_git/REPOSITORYNAME
Onward this URL will be named with the placeholder 'URL_TO_REPO'.
2) Add a remote to local repository
You could add a new remote (called here 'vsts_origin') by means of Visual Studio, the command line, or a simple text editor:
Visual Studio:
command line:
run this command to add a new remote called 'vsts_origin' to the local Git repository:
>git remote add vsts_origin URL_TO_REPO
text editor:
[remote "vsts_origin"] url = URL_TO_REPO fetch = +refs/heads/*:refs/remotes/vsts_origin/*
3) Push your local repository mybranch content to the remote repository
push your code using the newly create remote by means of executing from command line:
>git checkout mybranch
>git push -u vsts_origin mybranch
This will automatically create the remote branch called mybranch .
Upvotes: 5