Objectives

Day 1 Review: Git & GitHub Basics

Git Fundamentals

  • git init - Initialize repo
  • git add - Stage files
  • git commit - Save changes
  • git status - Check state
  • git log - View history

GitHub Remote

  • git remote add
  • git push
  • git pull
  • git clone
  • README & Markdown

Day 2 Review: Advanced Workflows

Branching & Merging

  • git branch
  • git checkout/switch
  • git merge
  • Conflict resolution

Advanced Commands

  • git rebase
  • git rebase -i
  • git reflog
  • git revert

How Teams Work with Git

When 2+ developers collaborate on a project:

Team Collaboration Workflow

main branch Developer 1 (feature-A) PR #1 Developer 2 (feature-B) PR #2

What is a Pull Request?

A Pull Request (PR) is a request to merge your changes into another branch (usually main)

PR Workflow

  1. Create a feature branch
  2. Make commits and push to GitHub
  3. Open PR on GitHub
  4. Request reviewers
  5. Address feedback if needed
  6. 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!

  1. Form teams of 2-4 people
  2. Create a simple project together (e.g., team members list)
  3. Each person creates a branch
  4. Each person adds their info (name, skills, bio)
  5. Each person opens a PR
  6. Review each other's PRs
  7. Merge all changes

💡 This simulates real team development!

Common Team Challenges

Merge Conflicts

Keeping Branches in Sync

When to Pull/Push

Best Practices for Team Work

📚 Homework

💡 Contributing to open source is a great way to learn!

1 / 14