| <- Previous: Branches, Forks, Origin, And Upstream | Next: Final Evaluation -> |
|---|
Diagnose common Git, SSH, signing, and remote problems without guessing.
- decide whether a problem is about installation, authentication, signing, or remotes
- run a short triage checklist before changing settings
- apply a targeted fix instead of repeating setup steps blindly
Run these commands first:
git --version
git config --global --list
ssh-add -l
git remote -v
bash scripts/run-full-check.shOn Windows PowerShell, replace the last command with:
powershell -ExecutionPolicy Bypass -File scripts/run-full-check.ps1On Windows Command Prompt, use:
scripts\run-full-check.cmdThese checks usually tell you whether the problem is local Git configuration, SSH authentication, or remote configuration.
Git is not installed or is not available on your shell PATH.
Fix:
- install Git again for your operating system
- open a new terminal session
- run
git --version
GitHub rejected the SSH connection. This is an authentication problem.
Fix:
- check whether the key is loaded:
ssh-add -l- if needed, start
ssh-agentand load the key again:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519- confirm that the public key in
~/.ssh/id_ed25519.pubis registered in GitHub as an Authentication Key - test again:
ssh -T git@github.comThis is a signing problem, not an authentication problem.
Check:
- the commit was created after signing was enabled
user.emailmatches an email associated with your GitHub account- the public key was also added to GitHub as a Signing Key
- these settings exist:
git config --global --get gpg.format
git config --global --get user.signingkey
git config --global --get commit.gpgsignIf the commit was created before signing was enabled, create a new signed commit.
Your remote is probably using HTTPS instead of SSH.
Check:
git remote -vIf the remote starts with https://github.com/, switch it to SSH:
git remote set-url origin git@github.com:username/repo.gitIn this course, origin should usually point to your own copy of the template repository.
This usually means you do not have a commit on the branch yet, or you are pushing the wrong branch name.
Fix:
- check the current branch:
git branch --show-current- create a commit if the repository is still empty
- push the current branch explicitly:
git push -u origin <branch-name>- You can tell whether a failure is about auth, signing, or remote URLs.
- You can explain why
Permission denied (publickey)andUnverifiedare different problems. - You know which commands to run before changing your setup.
| <- Previous: Branches, Forks, Origin, And Upstream | Next: Final Evaluation -> |
|---|