Why I Use GitHub
I use Git to track changes in my code and GitHub to host it online. Git runs on my machine. GitHub is the website that stores my repos and lets me share them.
If you’re new: Git is the tool, GitHub is where the repos live.
Install Git
Ubuntu:
sudo apt update
sudo apt install git
Arch Linux:
sudo pacman -S git
Check it worked:
git --version
Set Your Name and Email
Git attaches this info to every commit:
git config --global user.name "Your Name"
git config --global user.email "youremail@yourdomain.com"
Verify:
git config --list
Clone a Repo
Before adding files, clone the repo you want to work on:
git clone https://github.com/githubusername/repository
cd repository
Copy the URL from your repo page on GitHub.
Add, Commit, Push
After you add or edit files:
git add .
git commit -m "Describe what you changed"
git push origin main
If your default branch is master, use that instead of main.
GitHub will ask for your username and a Personal Access Token (PAT) — not your account password.
That’s It
That’s the workflow I use every time: clone, edit, add, commit, push. Nothing fancy, but it gets the job done.