Linux, terminal and Git

Stage 6 · Lesson 2 of 8

SSH keys for GitHub

GitHub and working with others

does not accept your account password for Git over . You use or a token instead. An SSH key comes as a pair of files: a private key you keep secret, and a public key you can share.

Generate a pair with ssh-keygen -t ed25519 -C "you@example.com" and protect it with a . Add the private key to your , a helper that remembers it for you. Paste the public key, the file ending in .pub, into GitHub's settings.

Then ssh -T git@github.com checks that it works. The private key never leaves your machine, and one key per machine is normal. On Windows, create the key inside WSL if you use Git in WSL.

Common trapsharing or uploading the private key, or copying it between machines instead of generating a new one.

A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it

Resources for this stage

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

Mark this stage as not done?