Git Commands
Here’s exactly what to type in your terminal at each step of the workflow. You can refer back to this page any time.
1. Pull the Latest Changes
Section titled “1. Pull the Latest Changes”Always do this before starting any new work:
git checkout maingit pullThis switches you to the main branch and downloads any new changes.
2. Create Your Branch
Section titled “2. Create Your Branch”Replace your-name/feature-name with something descriptive:
git checkout -b your-name/feature-nameExamples:
git checkout -b alex/add-walk-soundgit checkout -b sam/fix-wall-collisiongit checkout -b jordan/npc-interact-revamp
3. Make Your Changes
Section titled “3. Make Your Changes”Work normally; write code, add files, whatever you’re working on. Git is watching, but won’t do anything until you tell it to.
You can check what you’ve changed at any time:
git status4. Commit Your Work
Section titled “4. Commit Your Work”When you’re ready to save a checkpoint:
git add .git commit -m "Short description of what you changed"git add . stages all your changed files. git commit saves the snapshot.
5. Push to GitHub
Section titled “5. Push to GitHub”Upload your branch so it exists online:
git push origin your-name/feature-nameUse the same branch name you created in Step 2.
6. Open a Pull Request
Section titled “6. Open a Pull Request”- Go to the repository on github.com
- You’ll see a yellow banner: “your-branch had recent pushes”. Click Compare & pull request
- Write a clear title and description
- Click Create pull request
That’s it! A club president will review it and either approve it or leave feedback.
7. If Changes Are Requested
Section titled “7. If Changes Are Requested”Make the changes on your branch, then:
git add .git commit -m "Address review feedback"git push origin your-name/feature-nameThe PR updates automatically, no need to open a new one.