Git error trying to clone mafia

Ethelred

Member
I'm finally taking the plunge and trying to upgrade to the new version of mafia on github. I don't get very far. When I enter the "git clone git@github.com:kolmafia/kolmafia.git" command, I get

Code:
Cloning into 'kolmafia'...
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.

No idea what that means nor how to proceed. Please advise. Thanks.

Environment:
Code:
$git --version
git version 2.17.2 (Apple Git-113)
$java --version
openjdk 17 2021-09-14
OpenJDK Runtime Environment Temurin-17+35 (build 17+35)
OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing)
Mac OS X Mojave 10.14
 

fewyn

Administrator
Staff member
Use
Code:
git clone https://github.com/kolmafia/kolmafia.git

You're currently trying to login as the user git@github.com for some reason. Not sure where you got that command.
 

heeheehee

Developer
Staff member
If you go to https://github.com/kolmafia/kolmafia and click the green "Code" button, it will give you some sample commands to clone the repo.

IIRC, the git@github... url is only accessible if you have a SSH key that you've registered with github. If not, you'll want to use the HTTPS url that fewyn posted. We should update the wiki to specify the HTTPS url for Mac too.

Note that https://wiki.kolmafia.us/index.php/Compiling_from_Source#Linux makes that distinction (whether you have a github account vs not).
 

Ethelred

Member
Ok, thanks for the clarification. I (mostly) followed the Linux instructions and was able to build a standard version that ran. Next step is to see if I can apply my patches and get a patched version that runs. Sorry to be a dunce, but I thought I was following instructions. Thanks for the help.
 

MCroft

Developer
Staff member
Ok, thanks for the clarification. I (mostly) followed the Linux instructions and was able to build a standard version that ran. Next step is to see if I can apply my patches and get a patched version that runs. Sorry to be a dunce, but I thought I was following instructions. Thanks for the help.

You were! There was a missing step.

It worked for me because I had a git SSHkey already set up.

If you're going to save your code back to GitHub, it's a good idea to go ahead and use the SSHKey version, but it's not absolutely necessary.
 

MCroft

Developer
Staff member
updated https://wiki.kolmafia.us/index.php/Compiling_from_Source

I copied the Linux git vs. http instructions. Thanks, Linux instruction writer!

I took a first stab at Windows instructions. If someone can take a look at those, it would be great. Specifically, I have two questions:
1: Can we remove the Windows environment variable section (e.g. does installing Adoptium OpenJDK auto-handle path statements?
2: Can we remove Tortoise, or should we recommend GitHub client or some other tool for GIT (or none, if the GIT install is good enough).
3: Is there anything I missed?
 

Ethelred

Member
I notice the Mac OS X section does not mention the
Code:
git pull
command as in the Linux section. Also in the Linux section, that command and the compile command seem to be out of order. Shouldn't one get the updates before one compiles? Also I notice the pull command doesn't have any arguments to specify the project or path. Is that information stored someplace in the local project and automatically supplied? Sorry to ask so many basic questions, but the switch from SVN to Git has really thrown me off. I've never used Git before and am having trouble finding the basic info I need. Also, it's been many years since I set up my mafia project with SVN and have now forgotten most of what little I know about that. Thanks for the continued support and help.
 

heeheehee

Developer
Staff member
Also in the Linux section, that command and the compile command seem to be out of order. Shouldn't one get the updates before one compiles?
Yes, you probably want to update your repo before compiling.

Also I notice the pull command doesn't have any arguments to specify the project or path. Is that information stored someplace in the local project and automatically supplied?
When you clone a repo, git will automatically set the upstream origin for the default branch.

Code:
$ git branch -vv --list main
* main 38317eb3fa [origin/main: behind 1] Advent Calendar Items (#316)
for instance indicates that my local `main` branch tracks origin/main and is 1 commit behind.
 

MCroft

Developer
Staff member
It may be possible to merge the linux and MacOS instructions. The only remaining difference is that the Mac instructions used the gradlew runShadow command and the Linux commands used shadowJar followed by a java CLI command.
 
Top