Here is a guide on using the GUI TortoiseGIT, GIT for Windows with GitHub.
Creating a GitHub Account
Make sure you have a GitHub account (free is OK) https://github.com/
Login to GitHub
I used my defined hardware Security Key
I clicked New Repo
Repo Settings
- I set Private
- Added a readme
- Set .gitignore for Visual Studio files
- I had no idea what licence to select (read more on licences here)
I clicked Create repository
Creating RSA Keys
Now I will create an SSH key to protect communications with GitHub.
When logged into GitHub, I clicked the SSH and GPG Keys menu
I clicked New SSH Key button
GitHub wants a public SSH Key
I used this command to generate a public and private SSH key
ssh-keygen -t rsa
Generate key output.
FYI: These Keys have been deleted, they have not been used beyond this demo
A Public and Private key was generated
id_github_test.pub = Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKeAydCIpEB9EuBH/h0FbsnhUlmQT/ylKowlOWEkvl0CRZO2b7ak71GI5V4IJtVESjx/yZ3hHAhlOYp5VXbpTXv9rbKGEA12ii6d7cNOzfaAqXoHhdWqxfsfSRq0oocDVt1Inwdwsnh7tRqLHxRt0z0Gg/7m2s3sEIQqbtFkaQGjugQqs6Y9npWLd9utUcnUIRk3kajnlEeAZNVUMEn1hbX/PjODrzyI2JvGMxFzeRUTOSDWRAh6cNTM6fNZI6TLBdWHbmlZujgitiRxkWjmph31epxAkyTc0CsZ4VelU2uDgRLiWFdv+/SY2uT0/WaqZY3AlqM2GdR+WVTtiJJoh4e9ARR/ehZIkJMoWQlZa5Y8t1GnMcOa9sj3VTW5lGt1u+0JJP6IGa9T4UmxkqZRvJTDrZ1Flxcdu61is5tNLI10PYOcXz78jGSNnb8cfNzaMIHsI4oLMdurDDUz5w+5AQ9lA7gi4DE4uiX5cAsNe9jJsixB7TvCr6LF+k36Q0T3c= fearbys@PCName
id_github_test = Private Key
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABB8qp/Pde
q+G2Xrp+27vB7PAAAAEAAAAAEAAAGXAAAAB3NzaC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cXN1QLXvuAcFc0z
BQrh4aLy31dXpzoj0cPp3DMQF7jyp6mhcFopICrpUW+2wQKD8wOMc1BtziIpJtDXFQrh3l
QhN3/T15hnwgrt2qO/cyP0MxNLgVqN8F1+Am2gPqASyI0U/mZbh1W0ydpupcHBRc/BN37U
pc6KwT2uQ8D/b/Y8etn3QSlcTnVzZIFSSUWTHJKDnGIh/UwFj/6rESuuV+oSmH3nTVAjPT
XDTZUjd3GH7R4Ghf5dfl7eouHHLvYd58EVSZV1kGEY7W3jk74y0Vkjx9unjY1TtolIiNkD
A6h6Yt32e8MjNec0XzVHjEbXn+8=
-----END OPENSSH PRIVATE KEY-----
FYI: These Keys have been deleted, they have not been used beyond this demo
I added the Public Key to GitHub
SSH Keys are listed in GitHub
I create a different key per repository.
Setup Git Locally
I checked to see if the “git” command was installed on my local machine.
I will install Git from https://gitforwindows.org/
I download Git-2.32.0.2-64-bit.exe and started the installer
Folder C:\Program Files\Git
Set Options (e.g I like Check for Daily updates)
Start Menu Folder
Text Editor: I like Sublime Text from https://www.sublimetext.com/3
Set an Initial Branch name
Set 3rd party software options
Set HTTPS options
Set Line Endings preferences
Set Terminal Emulators preferences
Set Git Pull default preferences
Set Credential Manager preferences
Set Extra Options
Experimental Options
Installing
First Launch
Git is installed
Install Tortoise GIt
Visit https://tortoisegit.org/
Download Gif (64bit)
I started the installer.
Licence Agreement
SSH Type
Components
Install
Installing (Wizard)
Language: English
Shell Extension
I checked for a known git path.
I set my desired git username and email
I set desired SSH settings
Folder for Code Repositories
I create C:\Code\MyTestRepo
Before I can clone a repository I need o set the past to SSH in TortoiseGit.
I right-clicked on C:\Code\MyTestRepo and selected TortiseGit\Settings
I expanded the Network Node and set the following as the SSH Client
“C:\Program Files\TortoiseGit\bin\TortoiseGitPLink.exe”
I saved the Settings.
Clone a GitHub Repository via git and Tortoise GIT
Now I can clone a repositor to C:\Code\MyTestRepo,
I right clicked on C:\Code\MyTestRepo in explorer and clicked Git Clone
I added by GIT URL (Obtained from GitHub), I also set the path for the Private Key I created earlier.
I was informed that the key is in the wrong format
I need to convert the RAS Private Key to a Putty PPK Key
Convert an RSA Key to a Putty PPK with PuuttyGen
I opened the Open Putty Gen
I click Load and select the id_github_test private key I created earlier
I entered my private key password
The private key loaded.
Now I can export the private key to a PPK format
Clone (with a PPK Private Key)
Getting back to cloning a repository I right-clicked on C:\Code\MyTestRepo
I set the PPK private key
I entered the password
I accepted the key
The Repository started cloning.
Creating a Quick Visual Studio Project
I created a quick Visual Studio project and saved it to C:\Code\MyTestRepo\Hello World
Visual Studio files were visible in C:\Code\MyTestRepo
I Commit the new files to the repository (main branch)
I selected desired files to commit
Files were added
I right-clicked on C:\Code\MyTestRepo and selected TortoiseGit\Push
Files are now visible in GitHub
Awesome
Setup on Multiple Machines
I set up Git on multiple machines, cloned, made chances, committed those changes and pushed. I was able to Sync down those changes to each machine.
Good advice on Using Git
- Git Guides – git push (github.com)
- What is git commit, push, pull, log, aliases, fetch, config & clone | by Ameet Prajapati | MindOrks | Medium
- GitHub 101 — Introduction to GitHub for Newbies | by Arerosuoghene Wisdom | Medium
Happy Coding