Linux, terminal and Git

Stage 6 of 8 · 8 lessons · ~2 weeks

GitHub and working with others

Connect local repositories to GitHub with SSH keys, and work the way teams do: branches, pull requests, reviews, keeping forks up to date and the GitHub CLI.

Start: Remotes: clone, fetch, pull and push

Lessons· one lesson for each topic, in this order

  1. 1Remotes: clone, fetch, pull and push
  2. 2SSH keys for GitHub
  3. 3GitHub flow
  4. 4Writing a good pull request
  5. 5Giving and receiving review
  6. 6Forks and keeping them in sync
  7. 7The GitHub CLI
  8. 8Secrets, access and account safety

Do this

  • Create an ed25519 SSH key with a passphrase, add it to GitHub and test with `ssh -T git@github.com`.
  • Turn on two-factor authentication for your GitHub account.
  • Push a project and open a pull request with a proper description, then merge it.
  • Install `gh`, log in and open a pull request from the terminal.
  • Fork a project, add `upstream`, sync it and open a small pull request.
  • Review a classmate's pull request with at least three constructive comments.
  • Delete merged branches locally and on GitHub.

Start with· follow one of these

  • BookFree
    Pro Git

    Scott Chacon and Ben Straub

    Chapter 6 covers GitHub itself: forks, pull requests and maintaining a project

  • GuideFree
    Contributing to a Project (GitHub Docs)

    GitHub · Beginner

    GitHub's own walkthrough of the fork, branch and pull request workflow

Practise

  • A safe repository built for making your first pull request to someone else's project

Keep handy

Also worth your time

Before moving on: Two merged pull requests: one to a repository of your own using GitHub flow with a written description and a self-review, and one to someone else's project from a fork (documentation fixes count), both opened or checked with the GitHub CLI.

Tauseef's advice
Your pull requests are part of your portfolio, so write them like a colleague will read them. Small, clear pull requests get merged; huge ones get ignored. Review other people's work too: reading code with a question in mind teaches you more than writing it alone.

Mark this stage as not done?