git-remote-troubleshoot
Skill0 starsChanged 17 days agoMITView on GitHub
Diagnose Git remote and auth issues.
- Reads credentials
- Commits and pushes
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- buzzer-audio-previewSkill
- cvm-imagegenSkill
- docs-no-revision-markersSkill
- dst-dedicated-serverSkill
- firmware-display-previewSkill
- git-syncSkill
- linux-server-initSkill
- markdown-doc-styleSkill
- step-stl-print-repairSkill
- tavily-hikari-infraSkill
- xp-infraSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. About 0 are common, 9 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Never “work around” SSH failures by pushing via an explicit HTTPS URL (forbidden): git push -u https://github.com/<owner>/<repo>.git …
- Very specific: line 17
Never use git push <url> <branch> (URL-typed remote) as a workaround.
- Very specific: line 18
Do not rewrite origin (or any remote) to HTTPS as a workaround unless the user explicitly requests HTTPS.
- Very specific: line 19
Prefer read-only connectivity checks first: git ls-remote <remote>.
- Distinctive: line 20
Do not run git push unless the user explicitly asks you to push.
- Very specific: line 21
Do not modify global configs (~/.ssh/config, ~/.gitconfig, credential helpers) without asking first.
- Distinctive: line 25
Ask for (or run) these and capture the *full* error text:
- Very specific: line 39
SSH: if remote looks like git@host:owner/repo.git or ssh://...
- Very specific: line 40
HTTPS: if remote looks like https://host/owner/repo.git
- Distinctive: line 65
If the remote is GitHub and port 22 is blocked, test GitHub’s supported SSH-over-443 endpoint:
- Very specific: line 71
If port 443 works, apply GitHub’s official fix by adding this to ~/.ssh/config (ask before editing):
- Distinctive: line 97
If you need deeper SSH debug logs (still read-only), use:
- Distinctive: line 115
Ensure the correct public key is uploaded to the Git hosting account.
- Very specific: line 116
If multiple keys exist, pin the right key for the host in ~/.ssh/config:
- Very specific: line 126
Do not blindly delete known_hosts.
- Very specific: line 130
If you must remove an entry, remove only the matching host line (or use ssh-keygen -R <host> with explicit user approval).
- Distinctive: line 141
If GitHub is involved and auth fails, you generally need a PAT (password auth is not supported) or you should switch to SSH (user decision).
- Distinctive: line 143
If you need deeper HTTPS debug logs (read-only), use:
- Distinctive: line 151
After applying a fix, verify with a read-only operation:
- Distinctive: line 157
Only after the user explicitly asks to push, run the push using the configured remote name (not a raw HTTPS URL):
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git remote troubleshoot
Prerequisites and boundary
This is text-only guidance using installed Git and the existing SSH or HTTPS tools on Linux/macOS. It owns no production executable and requires no Bun/Python runtime for diagnosis. Start with git remote -v, git status -sb and the exact failing command/error; these identify the configured target and transport without changing local configuration. The result is a diagnosis, supporting read-only observations and a proposed minimal fix. Any config change or push follows the explicit authorization rules below.
Repository maintainers can run bun test ./tests/helper_sources.test.ts to exercise linked-source helper entrypoints and retained runtime boundaries. Bun is a developer/test prerequisite only for this text Skill; those smoke tests make no live connectivity or authentication claim.
Hard rules (strict)
- Never “work around” SSH failures by pushing via an explicit HTTPS URL (forbidden):
git push -u https://github.com/<owner>/<repo>.git <branch> - Never use
git push <url> <branch>(URL-typed remote) as a workaround; always use a configured remote name (e.g.,origin). - Do not rewrite
origin(or any remote) to HTTPS as a workaround unless the user explicitly requests HTTPS. - Prefer read-only connectivity checks first:
git ls-remote <remote>. - Do not run
git pushunless the user explicitly asks you to push. - Do not modify global configs (
~/.ssh/config,~/.gitconfig, credential helpers) without asking first; keep changes minimal and make a backup.
1) Collect minimal facts
Ask for (or run) these and capture the full error text:
git remote -v
git config --get remote.origin.url
git status -sbAlso collect:
- The exact failing command (
git clone/fetch/pull/push ...) - The network context (VPN? proxy? corporate network? captive portal?)
2) Classify: SSH vs HTTPS
- SSH if remote looks like
git@host:owner/repo.gitorssh://... - HTTPS if remote looks like
https://host/owner/repo.git
Proceed based on the transport.
Quick signature map
Connection closed by <ip> port 22/ssh: connect to host ... port 22: ...→ network path/port blocked (often port 22)Permission denied (publickey)→ SSH key selection/authz problemHost key verification failed→known_hostsmismatch / host key not trustedRepository not found→ wrong remote URL or missing access
3) SSH failures
A) Port 22 blocked / network path broken
Common indicators:
- Mentions
port 22,Connection timed out,Connection closed,No route to host ssh -T git@github.comfails quickly or hangs then fails
Safe tests (no pushing):
ssh -T git@github.comIf the remote is GitHub and port 22 is blocked, test GitHub’s supported SSH-over-443 endpoint:
ssh -T -p 443 git@ssh.github.comIf port 443 works, apply GitHub’s official fix by adding this to ~/.ssh/config (ask before editing):
Host github.com
HostName ssh.github.com
Port 443
User gitThen re-test:
ssh -T git@github.com
git ls-remote originReference (official GitHub docs):
https://docs.github.com/en/authentication/troubleshooting-ssh/using-ssh-over-the-https-portNotes:
- The first connection after switching to port 443 may show a
known_hostswarning; verify the host key against GitHub’s published fingerprints before accepting. - GitHub’s doc includes caveats for GitHub Enterprise Server and some Enterprise Cloud configurations (e.g., data residency).
If you need deeper SSH debug logs (still read-only), use:
GIT_SSH_COMMAND="ssh -vvv" git ls-remote originB) Permission denied (publickey)
This usually means SSH auth (key selection, agent, account access), not networking.
Checklist:
ssh -vT git@github.com
ssh-add -LCommon fixes:
- Ensure the correct public key is uploaded to the Git hosting account.
- If multiple keys exist, pin the right key for the host in
~/.ssh/config:
Host github.com
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yesC) Host key verification failed / host key mismatch
Do not blindly delete known_hosts.
Preferred approach:
- Identify the specific offending entry, and validate the expected fingerprint from the provider docs.
- If you must remove an entry, remove only the matching host line (or use
ssh-keygen -R <host>with explicit user approval).
4) HTTPS failures (when the remote already uses HTTPS)
Typical indicators:
fatal: Authentication failedHTTP 401/403SSL certificate problem
Workflow:
- First confirm basic reachability:
curl -I https://<host> - If GitHub is involved and auth fails, you generally need a PAT (password auth is not supported) or you should switch to SSH (user decision).
If you need deeper HTTPS debug logs (read-only), use:
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git ls-remote origin5) Verification before any write
After applying a fix, verify with a read-only operation:
git ls-remote originOnly after the user explicitly asks to push, run the push using the configured remote name (not a raw HTTPS URL):
git push -u origin <branch>Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

