Describe the bug
Cloning a repository through ssh and forking it adds the fork using the https protocol.
❯ gh --version
gh version 0.9.0 (2020-05-27)
https://github.com/cli/cli/releases/tag/v0.9.0
Steps to reproduce the behavior
- Make a temp directory:
cd $(mktemp -d)
- Clone a repository via ssh:
gh repo clone [email protected]:cli/cli.git
- Navigate into the repository:
cd cli
- Fork the repository:
gh repo fork --remote=true
- List all remotes:
git remote -v
Expected vs actual behavior
Expected behaviour
The new fork uses the ssh protocol because the repo was originally cloned through that.
Actual behaviour
The fork was added using the https protocol:
❯ git remote -v
origin https://github.com/thomaseizinger/cli.git (fetch)
origin https://github.com/thomaseizinger/cli.git (push)
upstream [email protected]:cli/cli.git (fetch)
upstream [email protected]:cli/cli.git (push)
Describe the bug
Cloning a repository through ssh and forking it adds the fork using the
httpsprotocol.Steps to reproduce the behavior
cd $(mktemp -d)gh repo clone [email protected]:cli/cli.gitcd cligh repo fork --remote=truegit remote -vExpected vs actual behavior
Expected behaviour
The new fork uses the ssh protocol because the repo was originally cloned through that.
Actual behaviour
The fork was added using the https protocol: