Jasinski Technical Wiki


Home Page
All Pages

Quick Search
Advanced Search »

Contributor Links

Create a new Page
File Management
Your Profile

Other Wiki Sections



Placing Local Code Under Git Source Control

Modified on Wed, Mar 29, 2023, 9:23 AM by Administrator Categorized as Visual Studio and Developer Tools


  1. Create repo on GitHub
  2. File Explorer: Navigate to source code root folder
  3. Rename folder
  4. Create new folder with old name
  5. Open a Command Window
  6. Navigate to NEW source code root folder, then up one level
  7. Command: git clone repo-url
  8. Move files from original folder into new folder
  9. Add a .GITIGNORE file - GitIgnore Files
  10. Change directory to the folder with the Git repo
  11. git add .
  12. git commit -m "Initial commit"
  13. git push

With Visual Studio 2019

  1. Open project/solution in Visual Studio 2019
  2. File > Add to Source Control
  3. Team Explorer > Sync > Push > Publish To GitHub
  4. Be sure to select the owner user/organization!
  5. Be sure to select "Private Repository" checkbox as appropriate!

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 SourceTree

  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

ScrewTurn Wiki version Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.