Sam
Sam

Reputation: 30388

Getting my code into a new Git repo on VSTS

This is the first time I'll be using Git on VSTS so I need a bit of help with the next steps.

I already have a new solution -- with multiple projects in it -- on my computer. I also created a new project on VSTS.

Here's what I want to do next:

  1. I first want to create two branches called "master" and "dev" so that I can manage my continuous integration properly.

  2. I then want to "push" my code into the "dev" branch. Not sure what the right terminology is in Git e.g. push, import, clone etc.

After creating the project on VSTS, here's what I'm seeing on the screen. How do I handle the steps I mentioned above from here?

enter image description here

Upvotes: 0

Views: 327

Answers (1)

jessehouwing
jessehouwing

Reputation: 114461

Use the Push Existing Repo from commandline, the steps are explained there quite clearly when you click the link on the screen you posted. You can't create the structure remotely, you push a local branch to a specific branch name on the remote. The easiest would be to take your current solution, commit it to a local repo, add the VSTS remote uri to your local repo and then use git push -u origin master to push the master branch. Then, checkout a local develop branch (git checkout -b develop and push the same branch as your remote using: git push -u origin develop to create the structure you want.

Or from the Visual Studio UI, go to the settings tab and add the VSTS remote: rightclick your local master branch and choose "Publish". Then create a new branch from master (from the context menu) and publish that too.

Upvotes: 1

Related Questions