Getting Started with Github

Chapter 3
6 min read
24 reads

This guide is designed for the absolute beginners. However, the assumption here is that you've already installed git and know what these commands do

git init
git add .
git commit -m "who let the dogs out"

If these commands look alien, you might want to go back and read the Git and CLIs part first. Better yet, you can learn more about git in the video: https://www.youtube.com/live/1F7gXTByduk?si=cequqjxk-ueJontl

Before anything else:

1. The Core Concept: Git vs. GitHub

  • Git: A tool on your computer that saves versions of your code (you know, like report-final.pdf, report-final2.pdf, etc). This is a tool you install on your laptop/comuter.
  • GitHub: A website where you upload those save points so others can see them, or so you can access them from another computer.

2. Setting Up the "Secret Handshake" (SSH)

When you push code to GitHub, it needs to verify you are really YOU. Using SSH keys is the professional way to do this without typing a password every time.

Step A: Generate the Key

  1. Open PowerShell on Windows.
  2. Paste this command (replace with your email):
 ssh-keygen -t ed25519 -C "your_email@example.com"
  1. Press Enter 3 times. Don't worry about a passphrase for now; just hit Enter until it finishes. This creates two files: a Private Key (staying on your PC) and a Public Key (going to GitHub).

Step B: Give the "Lock" to GitHub

  1. In PowerShell, run this to copy your public key:
cat ~/.ssh/id_ed25519.pub | clip
  1. Go to GitHub.com --> Settings --> SSH and GPG keys. (You can find settings by clicking your profile icon, in the top right corner).
  2. Click New SSH key, give it a title like "M1 MacBook" or "Windows Desktop," and paste the code you copied above into the box.

3. Configuring Your Identity

Git needs to know who to attribute the code to. Run these two commands in your terminal:

git config --global user.name "Moses Mbadi"
git config --global user.email "your_email@example.com"

4. Moving a Local Project to GitHub

Let’s say you have a folder and inside you have a file named main.py.

Step A: Initialize and Commit

Open...

Want to support this author?

By unlocking the full story, you directly support local writers. You'll also be able to track your reads, and discover amazing content!

Getting Started with Github - SELF TAUGHT COMPUTER SCIENCE | Soma