Public course previewThis is not your assigned passport. No identity, answers, or completion progress are stored here.How to start your passport
Guided lesson
01 / 02About 30 minuteschanges practice files

Configure Git Identity And GitHub Access

Inspect Git, the file-history program on your computer, the prepared practice clone, GitHub login and commit author. Repair only what is missing or wrong; keep working accounts and other repositories intact.

Where you will workOn the laptop or desktop in front of you
  1. 1Understand
  2. 2Try it yourself
  3. 3Check and submit

Before you start#

Git is version-control software: it records file versions. A repository is a project folder with history; a clone is its separate local working copy. GitHub stores the shared online copy; GitHub CLI (gh) acts through your login.

Setting Purpose Inspection
GitHub login Authorizes GitHub actions Which account gh uses
Git author identity Labels commits with name/email Effective values and their configuration source
Branch and origin remote Select work and its online repository Prepared practice branch and credential-free URL

A correct login does not set the commit author. A remote address must not contain a password or token. The repair below changes author identity only in this clone. GitHub Education is an optional student benefit application; waiting for approval does not block this Git practice.

Inspect all three settings before changing one. If the login is right but the author is wrong, which repair would address the actual problem?

Separate login from commit authorship

Keep the intended GitHub account. Confirm the effective name/email from the practice clone, then use its local identity repair only if needed. Inspect the branch and origin independently. Do not reset another project to match this one.

Repair the specific setting that failed, inside the practice repository.

Start the practice

Practice

Try it in your practice folder

Follow in order

Steps

Stay in the displayed practice folder. Inspect the login, author identity and branch before using a conditional repair.

Optional: using the terminal

A command is a line of text that tells a computer to do one task. You paste it into a terminal, the text application used for commands. A shell is the part inside that application that reads the command. PowerShell, zsh, and Bash are shells. Open only the application named for your computer below; it starts its configured shell. Follow the shell named below. You do not need to install a separate Bash or zsh application.

Your computer or local means the laptop or desktop in front of you. Remote means another computer reached through the network. A command affects whichever computer the step names, so check that label before pasting.

  • Windows: press the Windows key, type PowerShell, and open the result named PowerShell. Do not use Command Prompt, Git Bash, or WSL for a block labelled PowerShell.
  • macOS: press Command+Space, type Terminal, and press Return. Terminal normally starts the zsh shell. If it uses another shell, run zsh for this session.
  • Linux: open the app named Terminal from the applications menu. It normally starts the Bash shell. If it uses another shell, run bash for this session.

The prompt is the text beside the blinking cursor. For each card, check the named computer, choose Copy, paste only the command after the prompt, press Enter once, and wait for the prompt to return.

If you have never done this before, first run the harmless terminal-ready practice on the start page. It lets you practise copying, pasting, pressing Enter, and reading output before a setup command.

Practise one harmless command firstHow to open a terminal and run a command
  1. 01

    Know what Git and GitHub do

    Read and answer on this web page

    Git is version-control software: it records file versions on this computer. A repository is a project folder and its history; a branch separates work. A clone is a separate working copy. Git saves the online address under a short name called a remote; origin is the usual name. GitHub stores the shared online copy. GitHub CLI (gh) performs authenticated GitHub actions. Use the identity/login/remote table above before changing any settings.

    Look forYou can distinguish Git on your computer from GitHub on the web.

    Explanation and help
    What this means
    Prepare the isolated practice repository.
    Safe recovery
    Read the definitions before changing identity, login, branch, or remote settings.
  2. 02

    Prepare the Git practice folder

    On your computer

    Press Prepare practice folder in this step. Wait for the Passport to show one folder path and one practice branch. Run the displayed enter-folder command and keep this terminal in that folder.

    Practice folder

    The launcher creates or reuses the exercise folder for this course. It does not change another folder.

    Open this lesson from your local Passport to prepare the folder.

    Look forThe Passport reports a ready practice folder.

    Explanation and help
    What this means
    Use the displayed enter-folder command.
    Safe recovery
    Do not create or delete folders manually; run gh passport doctor.
  3. 03

    Check Git and GitHub CLI

    On your computer

    Open PowerShell on Windows or the Terminal application on macOS or Linux. On Linux, the terminal normally starts the Bash shell. Run both checks after entering the practice folder.

    RunPowerShell on Windows
    git --version
    RunTerminal on macOS (zsh)
    git --version
    RunTerminal on Linux (Bash)
    git --version
    RunPowerShell on Windows
    gh --version
    RunTerminal on macOS (zsh)
    gh --version
    RunTerminal on Linux (Bash)
    gh --version

    Look forEach command prints a version and no command-not-found error.

    If this differsInstall only the missing tool from its official link, close the terminal, reopen it, and rerun this step.

    Explanation and help
    What this means
    Continue to GitHub authentication.
  4. 04

    Check the GitHub account

    On your computer

    Run the status command before changing anything. Read the username shown under github.com.

    RunPowerShell on Windows
    gh auth status --active --hostname github.com
    RunTerminal on macOS (zsh)
    gh auth status --active --hostname github.com
    RunTerminal on Linux (Bash)
    gh auth status --active --hostname github.com

    Look forgh auth status names the intended GitHub username.

    If this differsIf no account or the wrong account is shown, use the next step. Never put a token in a repository URL.

    Explanation and help
    What this means
    Keep the working login and skip the next step.
  5. 05

    Sign in only when needed

    On your computer

    Run this only when the previous check showed no account or the wrong account. Enter the intended GitHub username. The command first tries to select an account already stored on this computer; otherwise it opens a new browser login. It does not remove another account.

    Show sign-in repair only if the account check failed (PowerShell on Windows)
    RunPowerShell on Windows
    & {
      $GitHubUser = Read-Host "Intended GitHub username"
      if ($GitHubUser -notmatch "^[A-Za-z0-9-]+$") { throw "STOP: invalid GitHub username" }
      gh auth switch --hostname github.com --user $GitHubUser
      if ($LASTEXITCODE -ne 0) { gh auth login --hostname github.com --git-protocol https --web }
      gh auth status --active --hostname github.com
    }
    Show sign-in repair only if the account check failed (Terminal on macOS (zsh))
    RunTerminal on macOS (zsh)
    (
    printf 'Intended GitHub username: '; read -r github_user
    case "$github_user" in ''|*[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-]*) printf 'STOP: invalid GitHub username\n' >&2; exit 1;; esac
    if ! gh auth switch --hostname github.com --user "$github_user"; then gh auth login --hostname github.com --git-protocol https --web; fi
    gh auth status --active --hostname github.com
    )
    Show sign-in repair only if the account check failed (Terminal on Linux (Bash))
    RunTerminal on Linux (Bash)
    (
    printf 'Intended GitHub username: '; read -r github_user
    case "$github_user" in ''|*[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-]*) printf 'STOP: invalid GitHub username\n' >&2; exit 1;; esac
    if ! gh auth switch --hostname github.com --user "$github_user"; then gh auth login --hostname github.com --git-protocol https --web; fi
    gh auth status --active --hostname github.com
    )

    Look forThe final status names the intended GitHub username.

    If this differsStop before creating commits. Finish the browser login or use the help path for the exact error.

    Explanation and help
    What this means
    Continue to the commit identity.
  6. 06

    Inspect your commit identity

    On your computer

    From the practice repository, print the effective name and email Git will attach to its commits and the configuration file each value comes from. A GitHub no-reply address is acceptable if you use it consistently.

    RunPowerShell on Windows
    git config --show-origin --get user.name
    git config --show-origin --get user.email
    RunTerminal on macOS (zsh)
    git config --show-origin --get user.name
    git config --show-origin --get user.email
    RunTerminal on Linux (Bash)
    git config --show-origin --get user.name
    git config --show-origin --get user.email

    Look forEach line names a configuration source followed by a non-empty name or valid email address.

    If this differsSet only the missing or incorrect values in the next step.

    Explanation and help
    What this means
    Keep the existing values and continue.
  7. 07

    Set identity only if needed

    On your computer

    Use this step only if the previous check was empty or wrong. Enter the author name and a verified GitHub email or GitHub-provided no-reply email. This sets the identity only in the practice repository, so it cannot silently change your other projects. The email identifies commits; it is not an ETH password or login.

    Show identity repair only if the name or email is wrong (PowerShell on Windows)
    RunPowerShell on Windows
    & {
      $GitName = Read-Host "Commit author name"
      $GitEmail = Read-Host "GitHub email or no-reply email"
      if ([string]::IsNullOrWhiteSpace($GitName) -or $GitEmail -notmatch "^[^@\s]+@[^@\s]+$") { throw "STOP: invalid name or email" }
      git config --local user.name "$GitName"
      git config --local user.email "$GitEmail"
      git config --show-origin --get user.name
      git config --show-origin --get user.email
    }
    Show identity repair only if the name or email is wrong (Terminal on macOS (zsh))
    RunTerminal on macOS (zsh)
    (
    printf 'Commit author name: '; read -r git_name
    printf 'GitHub email or no-reply email: '; read -r git_email
    if [ -z "$git_name" ] || ! printf '%s\n' "$git_email" | grep -Eq '^[^[:space:]@]+@[^[:space:]@]+$'; then printf 'STOP: invalid name or email\n' >&2; exit 1; fi
    git config --local user.name "$git_name"
    git config --local user.email "$git_email"
    git config --show-origin --get user.name
    git config --show-origin --get user.email
    )
    Show identity repair only if the name or email is wrong (Terminal on Linux (Bash))
    RunTerminal on Linux (Bash)
    (
    printf 'Commit author name: '; read -r git_name
    printf 'GitHub email or no-reply email: '; read -r git_email
    if [ -z "$git_name" ] || ! printf '%s\n' "$git_email" | grep -Eq '^[^[:space:]@]+@[^[:space:]@]+$'; then printf 'STOP: invalid name or email\n' >&2; exit 1; fi
    git config --local user.name "$git_name"
    git config --local user.email "$git_email"
    git config --show-origin --get user.name
    git config --show-origin --get user.email
    )

    Look forThe repeated check prints the values you entered and names .git/config as their source.

    If this differsDo not continue with an empty identity; correct the value or request help without including private information.

    Explanation and help
    What this means
    Continue to the optional student benefit.
  8. 08

    Students: verify your ETH email for GitHub Education

    Read and answer on this web page

    Students: open GitHub email settings on the same account confirmed above. If a verified ETH email is already listed, keep it and continue. Otherwise add the ETH email, open GitHub's verification message in your ETH mailbox, and finish verification. Do not make the address public unless you choose to. This optional benefit setup does not block the Git exercise. Never submit an ETH mailbox password or verification code here.

    Look forEligible students see their ETH address marked Verified. Staff and other ineligible learners skip this student-only step.

    Explanation and help
    What this means
    Eligible students open the Education application in the next step. Everyone else skips it and continues to the repository check.
    Safe recovery
    Continue the manual Git route while resolving email verification. Never submit mailbox codes to the Passport.
  9. 09

    Students: apply for GitHub Education

    Read and answer on this web page

    GitHub Education is GitHub's student-verification program; approved accounts can see the current Student Developer Pack benefits. Students: open Education benefits on the same account. If GitHub already shows approved student benefits, keep them and skip the application. Otherwise select Start an application and submit only the proof requested through that GitHub page. Staff and learners who are not eligible skip this step. Approval may take time and does not block Git practice.

    Look forEligible students see approved benefits or a pending application. Staff and other ineligible learners skip this student-only step.

    Explanation and help
    What this means
    Continue now. If your route later includes the AI tool mission, that mission will check whether Copilot is available.
    Safe recovery
    Continue the manual Git route. Do not buy a product to pass this mission.
  10. 10

    Inspect repository, branch, and remote

    On your computer

    Inspect the practice clone, its branch and origin remote using the existing commands. The remote is a saved repository address, not a login credential. If anything differs from the prepared folder/branch, stop and use the named recovery; do not switch or reset another project.

    RunPowerShell on Windows
    git status --short --branch
    git remote -v
    RunTerminal on macOS (zsh)
    git status --short --branch
    git remote -v
    RunTerminal on Linux (Bash)
    git status --short --branch
    git remote -v

    Look forThe branch starts with practice/. The lines beginning with origin point to the expected GitHub repository and contain no password or token.

    If this differsReturn to Prepare practice folder; do not edit the remote until the mismatch is understood.

    Explanation and help
    What this means
    Run Check my work.

Practise

One practice question. It does not affect your progress.

01gh shows the correct GitHub account, but git config prints a different author email. Will logging in again fix the next commit author?
See an explanation

Git author identity labels commits; GitHub authentication authorizes account actions. They are separate. Inspect before using the repository-local identity repair.

Finish the lesson

Questions to submit

Answer these 2 questions, then confirm the work you checked.

To pass: 80% and every safety question. Completion appears after the automatic GitHub check passes.

01What must gh auth status confirm?
02What should you do before repairing a failed tool check?
Before submitting
Open my real passport first

You can check sample answers here. Open your local Passport to check your practice files and submit the lesson.

Preview onlyYou can try the questions here. This page does not store or submit your answers.
Need help?Open recovery steps and AI-review guidance

If Blocked#

If the editor is missing, install only the editor; do not clone again. If the remote or branch is wrong, stop and run gh passport doctor. Do not delete the folder, reset Git, replace SSH keys, or paste a token into the remote URL. Use Request help without posting secrets on the Passport progress page if the doctor's named recovery command does not resolve the problem. Submit one issue without private information and return later; the reviewer does not need to be online.

Useful references:

Understand Before Accepting AI Output#

Do not let an AI assistant insert tokens, rewrite credential helpers, change the remote, or switch branches without explaining the exact reason. Verify the identity, remote, and branch yourself before accepting its claim of success.