Skip to main content

# GitHub Collaboration

Git manages your code locally. GitHub makes it collaborative, reviewable, and deployable. Even if you work solo, GitHub workflows create checkpoints that catch mistakes before they reach users.

Pushing to GitHub

# Create a new repo on GitHub (via CLI)
gh repo create my-project --public --source=. --remote=origin

# Or add a remote manually
git remote add origin https://github.com/yourusername/my-project.git

# Push your code
git push -u origin main

The `gh` CLI is GitHub's official command-line tool. Install it: brew install gh (macOS) or see cli.github.com.

Pull Requests: Your Safety Net

A pull request (PR) says: "Here are my changes. Review them before merging into main."

Unlock this lesson

Upgrade to Pro to access the full content

What you'll learn:

  • Create repositories on GitHub and push local projects to remote
  • Use pull requests for code review, even on solo projects
  • Write effective PR descriptions that explain context and trade-offs