Skip to content

feat: Add troubleshooting for Git URL rewriting and SSH host keys #41

@KemingHe

Description

@KemingHe

Is your feature request related to a problem? Please describe.

Users can encounter confusing, cross-domain issues when their local Git/SSH configurations are misaligned. Two specific problems have been identified:

  1. A url.<base>.insteadof rule in the user's Git config can silently rewrite https clone URLs to ssh, causing unexpected Permission denied (publickey) errors. The user is left debugging an SSH issue when they intended to use HTTPS.
  2. During an SSH connection attempt (which may be unintentional, per the point above), a user might permanently add an SSH host key to their known_hosts file and later need a clean, safe way to remove it.

Describe the solution you'd like

To address this, we will add two new, cross-referenced troubleshooting sections to our documentation guides.

1. Addition to use-cases-git.md

  • New Section: "Troubleshooting: When HTTPS Clones Fail with SSH Errors"
  • High-Level Content:
    • Explain how url.insteadof rules can cause this behavior.
    • Provide the diagnostic command: git config --global --list | grep insteadof.
    • Provide the fix command: git config --global --unset url.<value>.
    • Cross-Reference: Link to the SSH guide's new section for users who also need to clean up their known_hosts file.

2. Addition to use-cases-ssh-authentication.md

  • New Section: "Troubleshooting: Managing SSH Known Hosts"
  • High-Level Content:
    • Explain the purpose of the known_hosts file.
    • Provide the command for safely removing a host key: ssh-keygen -R hostname.
    • Cross-Reference: Note that unexpected host key prompts can be caused by Git's URL rewriting and link back to the new section in the Git guide.

This structure places the solution for each problem within the most relevant guide while ensuring the user can trace the issue across both domains.

Describe alternatives you've considered

An alternative is to place all the information in a single guide. We have rejected this because the root cause is in the Git configuration, while the host key management is purely an SSH task. Separating them respects the distinct scope of each guide and improves long-term maintainability.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions