Placing Local Code Under Git Source Control

With Visual Studio 2017

  1. Open project in VS 2017
  2. Open solution/project folder in File Explorer
  3. Close project in VS 2017
  4. Rename folder
  5. Create new folder with original name
  6. Create repo in new empty folder: VS > Team Explorer > Connect page > Local Git Repositories > New
  7. (No need to update .GITIGNORE file - VS creates it correctly)
  8. Move code from renamed folder into new folder
  9. Delete old (now empty) folder
  10. Open repo: VS > Team Explorer > Connect page > Local Git Repositories > (double click new repo)
  11. Commit changes to repo
  12. Create remote repo on GitHub
  13. Push to remote repo: VS > Team Explorer > Sync page > Publish > specify GitHub repo URL

With SourceTreee

  1. Add a .GITIGNORE file. (See this page - GitIgnore Files)
  2. Create a new Git Repository in the local folder
  3. Commit code to the local repository
  4. Create a new repository on GitHub
  5. Source Tree > Repository > Repository Settings > Add a new remote path (Remote name = "GitHub")
  6. Push local repository to GitHub