GitHub and Collaboration
Objective: Push your work to GitHub, use branches and pull requests, and understand collaborative workflows.
Git is the tool. GitHub is where your code lives online. It's how teams collaborate, how open-source software is built, and how you'll share your work with employers. You've been using Git locally since Phase 3. Now it's time to go remote.
The workflow: main branch stays clean. Create a branch for new work. Do the work. Merge back when done.
git remote add origin <url> Link your local repo to GitHub git push -u origin main Push to GitHub for the first time git push Push new commits after initial setup git pull Pull changes from GitHub to your local machine git clone <url> Download someone else's repository git branch List branches (* is where you are) git checkout -b feature-name Create and switch in one command git merge feature-name Merge a branch into your current branch git branch -d feature-name Delete a branch after merging - 1
Push your existing course-notes/ repo to GitHub. All your commit history from Phase 3 onward should be visible.
- 2
Create a branch called add-system-report. Add a new file. Commit it. Push the branch. Open a Pull Request on GitHub. Review your own changes. Merge to main.
- 3
Create a .gitignore file that ignores .swp, .tmp, and __pycache__/. Commit and push.
- 4
Find an open-source project on GitHub that interests you. Clone it. Read its README. Review its commit history with git log --oneline. Document what you observe.
- 5
Make a small edit to a file on GitHub directly using the web editor. Then git pull on your local machine. Understand what happened.