oyvindberg / bleep

A bleeping fast scala build tool!
MIT License
143 stars 21 forks source link

Trouble cloning github project #395

Closed dwalend closed 1 week ago

dwalend commented 1 week ago

When I

git clone --recurse-submodules https://github.com/oyvindberg/bleep.git

(from the README.md ) I get a lot of errors like:

Cloning into '/Users/dwalend/projects/bleep/liberated/libdaemon-jvm'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:bleep-build/libdaemon-jvm' into submodule path '/Users/dwalend/projects/bleep/liberated/libdaemon-jvm' failed
Failed to clone 'liberated/libdaemon-jvm'. Retry scheduled
Cloning into '/Users/dwalend/projects/bleep/liberated/librarymanagement'...

I bet this is a git puzzle, but haven't stumbled on the answer.

oyvindberg commented 1 week ago

you need to connect an ssh key to github - you need to do this to push code. maybe something like this https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

dwalend commented 1 week ago

That fixed it. Thanks!

(Huh. Just cloning the top level works fine without ssh keys.

$ git clone https://github.com/oyvindberg/bleep.git
Cloning into 'bleep'...
remote: Enumerating objects: 33374, done.
remote: Counting objects: 100% (5249/5249), done.
remote: Compressing objects: 100% (948/948), done.
remote: Total 33374 (delta 3462), reused 5074 (delta 3361), pack-reused 28125
Receiving objects: 100% (33374/33374), 24.93 MiB | 9.08 MiB/s, done.
Resolving deltas: 100% (25846/25846), done.

I wonder why git submodules care about who clones them.)

dwalend commented 1 week ago

Closing the ticket.

oyvindberg commented 1 week ago

it's a choice you do when you clone. you have cloned the top-level project with http, see https://github.com/oyvindberg/bleep.git. this is always permitted as long as the repo is public. However, by doing that you can not push changes, as there is no authentication mechanism when you do this.

for the submodules I've set them up to be checked out with the git protocol instead, which requires an ssh key for authentication.

if you want to push code for a PR, you'll need to clone bleep to your own fork, and check out that as another git remote and push to that. for that to work the fork will need to be cloned with the git protocol as well.