Skip to content

Instantly share code, notes, and snippets.

@hirezadehghani
Last active September 29, 2025 16:00
Show Gist options
  • Select an option

  • Save hirezadehghani/d3c8f9943f017a3c1b5ce177141cb0a3 to your computer and use it in GitHub Desktop.

Select an option

Save hirezadehghani/d3c8f9943f017a3c1b5ce177141cb0a3 to your computer and use it in GitHub Desktop.
Fix: Git thinks SSH when .git is in URL (GPG key conflict)
# Problem: Git uses SSH instead of HTTPS when .git is in repository URL
## Symptoms:
- Cloning/pulling fails with SSH authentication errors
- Happens even when using HTTPS URLs ending with `.git`
- Particularly affects setups with GPG signing
## Root Cause:
Git sometimes interprets URLs with `.git` suffix as SSH URLs when GPG keys are configured
## Solution:
Remove `.git` from the remote URL:
```bash
git remote set-url origin https://github.com/username/repository
# Instead of:
# git remote set-url origin https://github.com/username/repository.git
# Before (causing issues):
git clone https://github.com/torvalds/linux.git
# After (works correctly):
git clone https://github.com/torvalds/linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment