Setting Up GitHub to Work With Visual Studio 2013 Step-by-Step
Join the DZone community and get the full member experience.Join For Free
i’ll admit that the easier you make something, the more i will use it. while i know enough about the command line to work with github , i’d much prefer it to be integrated inside my ide. in this tutorial, i’ll show you just how to do that using visual studio 2013.
begin by creating any type of project. in my case, i created a new windows phone 8 app. again, this doesn’t matter. select “ file ”->” add to source control ” as shown below.
you will get an option to choose between tfs or git. select “ git ” and place a checkmark to use it in the future.
head over to github.com and create a new repository and give it any name you want. i named mine “ githubvs2013 ”, left the rest as default and finally hit “ create repository ”.
go inside the newly created repository and copy the clone url. you will need this in the next step.
beside the solution explorer tab, you will see team explorer . click on “ unsynced commits ” and add the clone url from the step before and press “ publish ”.
after you hit the publish button, you may need to authenticate with your github username and password if you have not done so already.
you should see the following message:
go ahead and hit the “ sync ” button and you will see the following message:
now that your account is tied to the repository, you need to upload any unsynced commits. select “ home ” from the team explorer menu then select “ changes ”.
here you will see a list of your project and all of the files to be included in the commit. give it a description and hit “ commit ”.
you should see now that your commit was created locally and you will need to sync to share your changes with the server. click on the “ sync ” button to do that.
this will bring you to unsynced commits. simply hit “ sync ” and then navigate over to your github.com repo and your project should be there.
making a change
if you switch back over to solution explorer and make a change, you will see a red check mark on the file as shown below. a blue keypad means that it is already checked in.
head back over to “ team explorer ” click “ changes ” then enter a description and click “ commit ”.
again you will be asked to sync with the server from your local repo, and you will need to click “ sync ” again.
switch back to github and look at your repo and the change should be reflected.
now in order to keep you sanity, bookmark this page and whenever you setup a new project you can use this guide to walk you through it. because if you are anything like me, you will forget in about 6 months (i mean minutes.) thanks for reading.
Published at DZone with permission of Michael Crump. See the original article here.
Opinions expressed by DZone contributors are their own.