Real-World GitHub Project Workflow
Now that you know the building blocks — commits, branches, pull requests, issues, and actions — it’s time to bring them together into a real-world GitHub project workflow.
This chapter will simulate how a team collaborates to build, track, test, and deploy a project using Git and GitHub.
Scenario:
You’re working with a team on a website project called MyPortfolio. Your role is to add a new “Contact” section.
Let’s walk through the typical GitHub workflow from start to finish.
Step 1: Clone the Repository
You begin by cloning the team repository to your local machine:
git clone https://github.com/team/myportfolio.git
cd myportfolio
Step 2: Create a Feature Branch
Branching keeps your work isolated and clean:
git checkout -b add-contact-section
This allows you to build the new section without affecting the main site.
Step 3: Make Code Changes
You add your HTML, CSS, or JS changes related to the contact form. Once done:
git add .
git commit -m "Add contact section with form and styles"
Step 4: Push the Feature Branch to GitHub
git push origin add-contact-section
This creates a remote branch on GitHub.
Step 5: Open a Pull Request (PR)
On GitHub:
- Go to the repo → Your new branch will appear
- Click “Compare & pull request”
- Add a title and a description of your changes
- Link related issues if applicable (e.g., “Fixes #7”)
Step 6: Team Review
Your teammates can:
- View the code
- Comment or request changes
- Approve the pull request
Once approved, you or the maintainer will merge it into the main
branch.
Step 7: GitHub Actions Runs Tests
If your project uses GitHub Actions, a test script will run automatically after the pull request is pushed or merged.
For example:
- Linting JavaScript
- Running unit tests
- Deploying to GitHub Pages or Netlify
You’ll see status checks below the PR.
Step 8: Clean Up
After your PR is merged:
git checkout main
git pull origin main
git branch -d add-contact-section
Step 9: Track Progress Using Issues & Projects
- Open an issue for each task or bug
- Organize work using project boards
- Use milestones to group issues for releases
Example Project Board Columns:
- To Do
- In Progress
- Review
- Done
Summary: GitHub Workflow Recap
Step | Action |
---|---|
Clone | git clone |
Branch | git checkout -b |
Code | Edit + git add + git commit |
Push | git push origin [branch] |
PR | Create Pull Request |
Review | Team reviews + merges |
Actions | Tests and deploy |
Clean | Delete merged branch |
This workflow is used by open-source projects, startups, and enterprises around the world — and now, you’re ready to follow it too.