On this page:
Side page to the start-from-zero pages. Read it before Git, GitHub and pull requests if you have never used git, a terminal or GitHub Desktop. Next: Git, GitHub and pull requests.
Unfamiliar word or acronym? The Glossary defines it.
Status: vendor steps checked against vendor documentation. The git commands on this page are standard and stable. The vendor steps (GitHub settings pages, GitHub Desktop menus,
ghand git install commands, the no-reply address format) were read from the vendors' own pages on 2026-10-21; each such passage names its source URL and that date. Vendor interfaces change, so check the page if a button has moved. Anything I could not read on a vendor page is marked est. (estimate) and is a guess to check. Nothing here was run on your machine.Prerequisites. A computer with internet access and an email address you can read. No git, no command line and no GitHub knowledge. About 90 minutes the first time, including the exercise at the end.
Git is a program on your computer. It remembers every version of the files in a folder, like the "version history" in a shared document, but for a whole folder, and you decide when to save a version.
GitHub is a website. It stores a copy of that folder online so other people can see it, copy it and suggest changes. It is to git roughly what a photo-sharing site is to a camera: the camera (git) works with no website, and the website (GitHub) is where you share what the camera took.
An analogy for the words you are about to meet:
| Everyday idea | Git word | What it means |
|---|---|---|
| A project folder with its whole history | Repository (repo) | The files plus every saved version of them |
| Your own photocopy of someone else's project, kept on the website | Fork | A copy of a repository under your account |
| Copying a project from the website to your computer | Clone | Download a repository, history included |
| A draft you can mark up without touching the original | Branch | A parallel line of history |
| Saving a version with a note | Commit | A snapshot plus a message saying why |
| Uploading your saved versions to the website | Push | Send commits from your computer to GitHub |
| Asking the owner to take your changes | Pull request (PR) | A proposal to merge a branch |
| The website copy you cloned from | Remote, usually named origin |
The other copy git talks to |
The Glossary has all of these. The bigger picture of why this project uses pull requests is on Git, GitHub and pull requests.
Source: GitHub Docs, "Configuring two-factor authentication" (https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication), retrieved 2026-10-21.
Screenshot to take yourself: the GitHub page where two-factor authentication is switched on. Capture: the Password and authentication settings page after 2FA is enabled, cropped to the panel. Look for: the line showing that an authenticator app is set up and the recovery codes option. Redact: your username, email address, avatar, any QR code, any recovery code, and the browser address bar and tabs.
You will practice on a copy, never on the original, so you cannot break anything.
Source: GitHub Docs, "Fork a repository" (https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo), retrieved 2026-10-21.
Screenshot to take yourself: your fork's front page right after forking. Capture: the repository header showing "forked from" under the repository name. Look for: your username in the repository path and the "forked from" line. Redact: your username, avatar, and anything in the browser chrome.
There are two ways. Both do exactly the same thing underneath. Pick one and do the exercise at the end with it; if you are curious, do it again the other way.
| Question | GUI path: GitHub Desktop | Command-line path: git and gh |
|---|---|---|
| What you do | Click buttons | Type commands |
| Good for | Your first hour; seeing changes as colors | Everything later; copy-pasting from guides; servers, which have no mouse |
| Install | One installer (Windows 10 64-bit or later, macOS 12.0 or later) | git, plus the GitHub CLI (gh) |
| Linux | Not supported ("Linux is not yet supported" on the vendor's install page); use the command line | Fully supported |
If you have never used a terminal, start with the GUI path. The command-line path is still worth learning, because this project's guides (and nearly every engineering team) use it.
GitHub Desktop is a free app from GitHub that wraps the git commands in buttons.
Sources, all retrieved 2026-10-21: GitHub Docs, "Installing GitHub Desktop" (https://docs.github.com/en/desktop/installing-and-authenticating-to-github-desktop/installing-github-desktop), "Authenticating to GitHub in GitHub Desktop" (https://docs.github.com/en/desktop/installing-and-authenticating-to-github-desktop/authenticating-to-github-in-github-desktop), "Cloning and forking repositories from GitHub Desktop" (https://docs.github.com/en/desktop/adding-and-cloning-repositories/cloning-and-forking-repositories-from-github-desktop), "Managing branches in GitHub Desktop" (https://docs.github.com/en/desktop/making-changes-in-a-branch/managing-branches-in-github-desktop), "Committing and reviewing changes to your project in GitHub Desktop" (https://docs.github.com/en/desktop/making-changes-in-a-branch/committing-and-reviewing-changes-to-your-project-in-github-desktop), "Pushing changes to GitHub from GitHub Desktop" (https://docs.github.com/en/desktop/making-changes-in-a-branch/pushing-changes-to-github-from-github-desktop) and "Creating an issue or pull request from GitHub Desktop" (https://docs.github.com/en/desktop/working-with-your-remote-repository-on-github-or-github-enterprise/creating-an-issue-or-pull-request-from-github-desktop).
Screenshot to take yourself: GitHub Desktop signed in, before you open a project. Capture: the Welcome window or the main window showing that you are signed in. Look for: the list of your repositories, or the "Clone a repository from the Internet" option. Redact: your username, name, email address, avatar and the repository list if it names private projects.
Clouds-Against-Humanity in the list. You can also click URL and paste the address of your fork.(Another route: on your fork's GitHub page, click Code, then Open with GitHub Desktop, then Choose... and Clone.)
fix-readme-word. Use lowercase words joined by dashes.main, and click Create Branch.README.md. Save the file.README.md with a yellow icon (modified), and the diff shows the change. Keep its checkbox ticked so it is included.Fix one word in the README in the Summary field. Click Commit to fix-readme-word.Screenshot to take yourself: GitHub Desktop with one committed change on your branch. Capture: the Changes view showing the diff, and the commit box. Look for: the red and green lines and the branch name on the top button. Redact: your name, email address, local folder path (it contains your computer username) and the repository list.
A terminal is a window where you type a command and the computer types the answer back. The program inside it, the shell, reads what you typed. A command is one instruction, for example git status. Opening a terminal is harmless. Nothing happens until you press Enter. For more than git needs (moving around, pipes, exit codes, a first script), see The terminal and your first script.
How to open one:
| System | How (est.) |
|---|---|
| Windows | Press the Windows key, type PowerShell, press Enter. After installing git you also get Git Bash in the same menu. The commands on this page work in both. |
| macOS | Press Command and Space, type Terminal, press Enter. |
| Linux | Press Ctrl, Alt and T on most desktops, or search the applications menu for Terminal. |
You will see a prompt: a short line ending in a symbol such as $ or >, which means "ready for a command". Type a command after it and press Enter. This page leaves the prompt out of the code blocks so you can copy each block as it is.
Three habits that make it easy:
Sources, retrieved 2026-10-21: https://git-scm.com/install/windows, https://git-scm.com/install/mac and https://git-scm.com/install/linux.
| System | Install |
|---|---|
| Windows | Download the installer from the git-scm.com Windows page, or run the winget command below. The project notes the winget package is not maintained by the Git for Windows project and may be behind the newest version |
| macOS | xcode-select --install (Apple's Xcode Command Line Tools include git), or brew install git with Homebrew. The project notes non-source builds are provided by third parties |
| Debian or Ubuntu | sudo apt-get install git (the vendor page shows the same without sudo, as root) |
| Fedora | sudo dnf install git |
winget install --id Git.Git -e --source winget
Expected (est.): a progress bar, then a line saying the install succeeded. Close the terminal and open a new one so it finds git.
sudo apt-get install git
Expected (est.; Debian, Ubuntu): it asks for your password (you will not see the letters as you type), lists packages and finishes without a line starting E:.
Now check it:
git --version
Expected: one line such as git version 2.x.y. The exact number does not matter. If you see "command not found" or "not recognized", git is not installed or the terminal was open before you installed it: close it, open a new one and try again.
Every commit records who made it. Tell git once. Use placeholders below; type your own values.
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR-EMAIL"
Expected: nothing at all. In a terminal, silence usually means success.
Check what you set:
git config --global --list
Expected: lines including user.name=YOUR NAME and user.email=YOUR-EMAIL.
A note on the email. Your commits, and the email in them, are public once you push to a public repository. GitHub offers a no-reply address that hides your real one. Its format is ID+YOUR-USERNAME@users.noreply.github.com, where ID is a number GitHub gives you. To find it and to hide your real address, click your profile picture, then Settings, then Emails in the "Access" section, and select Keep my email addresses private. Sources, retrieved 2026-10-21: GitHub Docs, "Setting your commit email address" (https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address) and "Email addresses reference" (https://docs.github.com/en/account-and-profile/reference/email-addresses-reference), which gives the ID+USERNAME@users.noreply.github.com form. The "Emails" page shows the exact address to use (est.).
ghTo talk to GitHub, git has to prove who you are. There are two ways.
https://github.com/...) and a login. Easy to start. The login is no longer a password but a token: a long random string that works like a password for a program.The easiest start is HTTPS with the GitHub CLI. The GitHub CLI (command-line interface; the program is called gh) signs you in through your browser, stores the credential for you and sets git up to use it (see the note after gh auth login below on where it is kept). You never copy a token by hand. You can move to SSH later if you want to.
Sources, retrieved 2026-10-21: the GitHub CLI README (https://github.com/cli/cli#installation) and its install pages for Windows, macOS and Linux.
| System | Install |
|---|---|
| Windows | winget install --id GitHub.cli --source winget |
| macOS | brew install gh (needs Homebrew) |
| Linux | Follow the Debian/Ubuntu or Fedora/RHEL section of the Linux install page. They first add GitHub's own package repository, then install gh with apt or dnf. Copy the current commands from that page, because the signing-key details change |
winget install --id GitHub.cli --source winget
Expected (est.): a progress bar and a success message. The vendor page says to open a new window afterwards so the changed PATH (the list of places the system looks for programs) takes effect.
gh --version
Expected (est.): a line starting gh version, then a link to the release notes.
gh auth logingh auth login
Source for the next two commands: the gh auth login manual (https://cli.github.com/manual/gh_auth_login), retrieved 2026-10-21. It says the default is a web-based browser flow, that the token is then stored securely in the system credential store (falling back to a plain text file if no store is found), and that the git protocol can be chosen during the interactive prompting.
Expected (est. for the exact wording of the questions): a few questions. Choose GitHub.com, then HTTPS, answer Yes to authenticating git with your GitHub credentials, and choose Login with a web browser. It prints a one-time code (eight characters), you press Enter, your browser opens, you type the code and approve. The terminal then says you are logged in as your username.
Where the token is kept. gh stores the token in the system credential store when it finds one. If it cannot find one, which can happen on Linux without a desktop keyring, it falls back to writing the token to a plain text file, as the manual above says. Per the gh help environment manual page (https://cli.github.com/manual/gh_help_environment, retrieved 2026-10-21), gh keeps its configuration files in $XDG_CONFIG_HOME/gh if that is set, otherwise $HOME/.config/gh (on Windows, $AppData/GitHub CLI). The token file is in that folder (the file name hosts.yml is est.; the manual does not name it). Treat that folder like a password: do not copy it, do not put it in a project folder, do not back it up to a shared place, and do not paste its contents anywhere. If you suspect it leaked, revoke the token in your GitHub settings and run gh auth login again.
Check it:
gh auth status
Expected: a line saying you are logged in to github.com, and which protocol git uses (https). It does not print the token (est.).
Replace YOUR-USERNAME with your GitHub username.
git clone https://github.com/YOUR-USERNAME/Clouds-Against-Humanity.git
Expected: lines such as Cloning into 'Clouds-Against-Humanity'..., counts of objects, then Resolving deltas: 100%. A new folder with the project's name appears in the folder you were in.
Move into it. cd means "change directory" (directory is another word for folder):
cd Clouds-Against-Humanity
Expected: nothing printed. Your prompt usually now shows the folder name.
git statusgit status
Expected, on a fresh clone: On branch main, Your branch is up to date with 'origin/main'., and nothing to commit, working tree clean. The working tree is the files in the folder. Clean means you have not changed any. Run this command whenever you are unsure; it never changes anything.
git switch -c fix-readme-word
Expected: Switched to a new branch 'fix-readme-word'. The -c means "create". Now git status starts with On branch fix-readme-word.
Open README.md in a text editor, change one word, and save. Then:
git status
Expected: Changes not staged for commit: and, in red, modified: README.md.
git diff
Expected: a block showing the file name, then lines starting with - (removed, red) for the old text and + (added, green) for the new. If the output stops at a : or (END), press q to leave the viewer.
Git saves in two steps. First you choose what goes into the snapshot (staging; the chosen files sit in the staging area). Then you take the snapshot.
git add README.md
Expected: nothing printed. git status now shows Changes to be committed: in green.
git commit -m "Fix one word in the README"
Expected: a line like [fix-readme-word abc1234] Fix one word in the README and a summary: 1 file changed, 1 insertion(+), 1 deletion(-). The short code (abc1234 here) is the start of the commit's fingerprint. If git instead says Please tell me who you are, redo the name and email step above.
git push -u origin fix-readme-word
Expected: lines about writing objects, then * [new branch] fix-readme-word -> fix-readme-word and branch 'fix-readme-word' set up to track 'origin/fix-readme-word'. Often it also prints a link for opening a pull request. The -u links your local branch to the one on GitHub so later you can just type git push.
Important: a fork's pull request offers the original project by default. For the exercise you want your own fork as the target. The --repo option names the target explicitly.
gh pr create --repo YOUR-USERNAME/Clouds-Against-Humanity --base main --head fix-readme-word --title "Fix one word in the README" --body "Practice change on my own fork."
Expected: a web address ending /pull/NUMBER, where NUMBER is the pull request's number (it is not always 1). Open it in a browser. That is your pull request.
git add, git config and cd print nothing when they work.error: and fatal: are failures. Read the line after it; git usually says what to do.hint: lines are advice, not errors.warning: lines mean it worked, but look.-, added lines begin with +. The sign is the reliable part.: or (END) at the bottom) shows long output one screen at a time. Press q to leave, Space for the next page.None of these loses your work if you read first. Run git status before you try anything.
fatal: not a git repositoryYou are in the wrong folder. Git commands only work inside a project folder.
pwd
Expected: prints the folder you are in (on Windows PowerShell use Get-Location). It is probably not the cloned project.
cd Clouds-Against-Humanity
Expected: no output. Then git status works. If the folder is somewhere else, cd to its full path.
Authentication failed (or could not read Username)GitHub did not accept your login. With HTTPS the account password does not work; the credential has to come from gh or a token.
gh auth status
Expected: if you are signed out or the token expired it says so. Fix it by signing in again:
gh auth login
Expected: the same questions as before, ending in a logged-in message. Then repeat the git command. Also check that you cloned your fork, not the original, because you cannot push to a project you do not own.
A merge conflict happens when two changes touch the same lines and git cannot choose. Git stops and marks the file. It looks like this inside the file:
<<<<<<< HEAD
the line from your branch
=======
the line from the other branch
>>>>>>> main
Expected: git status says You have unmerged paths and lists the file under both modified:. That is the file to fix; below, PATH-OF-THE-FILE stands for the path git status shows. To fix it:
<<<<<<<, =======, >>>>>>>) and the text you do not want.Save, then tell git it is resolved:
git add PATH-OF-THE-FILE
git commit -m "Resolve merge conflict"
Expected: a commit line like before. If you panic, you can undo the whole merge attempt:
git merge --abort
Expected: no output, and git status returns to normal. (If the conflict came from a rebase, use git rebase --abort; git tells you which one is in progress.)
You are in 'detached HEAD' stateHEAD is git's name for "where you are now". Normally it points at a branch. Detached means it points at one old commit, usually because you checked out a commit or a tag. Commits made here belong to no branch and are easy to lose.
git status
Expected: HEAD detached at abc1234. If you made no changes worth keeping:
git switch main
Expected: Previous HEAD position was ... then Switched to branch 'main'. If you did commit and want to keep it, give it a branch name first:
git switch -c rescue-branch
Expected: Switched to a new branch 'rescue-branch', with your commits on it.
main by mistakeYou meant to be on a branch but were on main. Fix it before you push. First look at where the commit is:
git status
Expected: On branch main and Your branch is ahead of 'origin/main' by 1 commit. This keeps the commit on a new branch, then moves main back to match the remote:
git branch fix-readme-word
git reset --hard origin/main
git switch fix-readme-word
Expected: the first command prints nothing. The second prints HEAD is now at .... The third prints Switched to branch 'fix-readme-word', and your commit is on it. Warning: git reset --hard throws away uncommitted edits. Commit them first, and only use it when git status showed that the only extra commit was the one you just saved on the new branch. If you already pushed to main of your own fork, it is only your copy. On a shared project, ask the owner before changing main; Git, GitHub and pull requests explains why this project blocks it.
This changes only your own fork, not the original project. But a fork of a public repository is public. Anyone can see your fork, your branch and your pull request, so put nothing private in it: no real names of your accounts, no addresses, no secrets. If you want a private copy to hold real values later, read Fork, private stacks and the pipeline first; do not make private work inside a public fork. For this exercise you change one harmless word. If anything looks wrong, delete the fork on GitHub and start again. It takes about 20 minutes.
fix-readme-word.README.md, on that branch. Save.Delete the branch. Click Delete branch on GitHub. Then tidy up your computer. On the command line:
git switch main
git pull
git branch -d fix-readme-word
Expected: Switched to branch 'main'; git pull prints Updating ... and Fast-forward with your change (it brings the merged work down to your computer); the last prints Deleted branch fix-readme-word. In GitHub Desktop: switch to main from Current branch, click Fetch origin then Pull origin (est.), then right-click the old branch and choose Delete (est.).
Checkpoint: your fork's main shows the one-word change, the branch is gone, and you can say in your own words what clone, branch, commit, push and pull request each did.
Screenshot to take yourself: the merged pull request on your own fork. Capture: the pull request page showing the purple Merged label and the Files changed diff. Look for: one removed line and one added line, and the Delete branch button or message. Redact: your username, email address, avatar and anything in the browser chrome.
git log --oneline and describe each line in your own words. Expected: one line per commit, newest first, with the short code and the message.