Working With Git

  1. Open Visual Studio, using the menu, choose Tools, then Options. Located the 'Source Control' option and makes sure the Current Source Control Plug-in is set to 'Microsoft Git provider'
  2. Log into Git and create a new respository, choose the private option, unless you want to make your project public
  3. Copy the URL of the respository (you will paste it later)
  4. Create a new project in Visual Studio, and ensure that the Add to Source Control checkbox is checked before you click OK
  5. When prompted to choose a source control system, choose Git
  6. Visual Studio will now maintain a local respository for your code, however we now need to connect to the remote server - this means that you can push your work to the server at the end of each development session, and pull that work into Visual Studio on another machine at a later time
  7. Open the Team Explorer window in Visual Studio (you can use the View menu to do this), once open, click the dropdown arrow towards the top right of the screen and choose 'Changes'
  8. In the yellow box that appears, type the words 'Initial Commit' and press the commit button, if prompted save any files. (If 'commit' is grayed out then click configure and enter the releveant details, then go back a step.)
  9. A message will appear confirming the Commit was created locally
  10. Choose either the 'sync' option that appears or choose 'Unsynced Commits' option from the dropdown, and in the Remote Repository section, paste the HTTPS URL of the repository and click Publish
  11. If prompted enter the credentials for the respository
  12. Return to Git and refresh the page relating to your respository. You should now see your project files
  13. You can find more about using Git in Visual Studio on the MSDN site