Git module
Lesson 10
GitHub basics
Create a GitHub repository and push over HTTPS (or SSH) when you are ready.
beginner35 minRun on your machine
What you will be able to do
- Create an empty GitHub repo in the browser
- Describe HTTPS vs SSH authentication at a high level
- Push main to GitHub (optional if you have an account)
Why this matters for data work
GitHub (or GitLab/Bitbucket) hosts the remote, PRs, and CI. You do not need a paid org to practice with a private personal repo.
Concepts
- Empty repo on GitHub — no README if you already have local commits (avoids pull clash)
- HTTPS + credential helper / token
- SSH keys — alternate auth
- Visibility: private vs public
Practice on your machine
Always (no account required)
You already pushed to a bare remote in Remotes. That is enough to understand the data flow.
Optional — real GitHub
- Create a free account at github.com if needed.
- New repository → name
dcubes-git-lab→ empty (no README). - Copy the HTTPS URL.
- Point origin at GitHub (replace URL):
cd ~/dcubes/git-lab/init-demo
git remote remove origin
git remote add origin https://github.com/YOURUSER/dcubes-git-lab.git
git push -u origin main
Use a personal access token when prompted for a password over HTTPS.
What you should see
- Optional: GitHub shows your files on
main. - Or: you skip optional and still understand remotes from the bare-repo lab.
Common mistakes
- Initializing README on GitHub when local history exists — first push rejected until you pull.
- Committing
.envbefore push — checkgit statusand.gitignore.