Shared Repository - Everyone works on the same codebase
Feature Branches - Each developer works on separate branches
Regular Sync - Pull updates from main frequently
Pull Requests - Request to merge your changes
Code Review - Team members review each other's code
Merge - Approved changes get merged to main
Team Collaboration Workflow
What is a Pull Request?
A Pull Request (PR) is a request to merge your changes into another branch (usually main)
PR Workflow
Create a feature branch
Make commits and push to GitHub
Open PR on GitHub
Request reviewers
Address feedback if needed
Merge when approved ✅
Creating Your First PR
# 1. Fork/Clone the repository
git clone https://github.com/username/repo.git
cd repo
# 2. Create a new branch
git checkout -b feature/my-feature
# 3. Make changes and commit
git add .
git commit -m "Add my feature"
# 4. Push to your fork
git push origin feature/my-feature
# 5. Go to GitHub and click "Create Pull Request"
# 6. Add title, description, and request reviewers
Code Review Best Practices
As a Reviewer
Be respectful & constructive
Focus on code, not person
Ask questions to understand
Suggest alternatives
Approve when ready ✅
As an Author
Don't take feedback personally
Respond to all comments
Explain your approach
Make requested changes
Thank reviewers 🙏
🛠️ Team Project Exercise
Let's Build Together!
Form teams of 2-4 people
Create a simple project together (e.g., team members list)
Each person creates a branch
Each person adds their info (name, skills, bio)
Each person opens a PR
Review each other's PRs
Merge all changes
💡 This simulates real team development!
Common Team Challenges
Merge Conflicts
Happen when multiple people edit the same file
Resolve by communicating with your team
Use git merge or git rebase to resolve
Keeping Branches in Sync
Regularly git pull origin main to stay updated
Merge main into your branch before creating PR
When to Pull/Push
Pull before starting work
Push at end of day or after major changes
Best Practices for Team Work
Clear commit messages - Explain what and why
Small, focused PRs - Easier to review
Regular communication - Use Slack, Discord, etc.
Pull before push - Avoid conflicts
Test your changes - Don't break the build
Document your code - Help your teammates understand
Be responsive - Reply to review comments quickly
📚 Homework
Complete the team project
Practice reviewing code - Review at least 2 PRs
Explore open source projects on GitHub
Find a project you're interested in
Read their CONTRIBUTING.md
Look for "good first issue" labels
💡 Contributing to open source is a great way to learn!