How to connect to Github
Mostrar comentarios más antiguos
Hi, I cloned and modified the content of my github repository on my mac, and I am just wondering how to push the modified files back into my github repo again.
On R2024a matlab's command window, I ran:
>>!git config --global commit.gpgsign true
>> !git config --global user.signingkey 12345678910
>> !git config --global gpg.format openpgp
>> !git config --global gpg.openpgp.program mykeyname
>> !git commit -m "update thurs evening"
where
12345678910 is the Key ID for my GPG Key called mykeyname on github. But I got the error:
error: cannot run mykeyname: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object
EDIT: I then tried fiddling more and got:
>> !git config --global --list
WARNING: terminal is not fully functional
- (press RETURN)
user.name=Sayaka (Saya) Minegishi[m
user.email=“********@gmail.com”[m
user.signingkey=12345678910[m
user.name=“Sayaka[m
filter.lfs.required=true[m
filter.lfs.clean=git-lfs clean -- %f[m
filter.lfs.smudge=git-lfs smudge -- %f[m
filter.lfs.process=git-lfs filter-process[m
core.longpaths=true[m
commit.gpgsign=true[m
gpg.program=/opt/homebrew/bin/gpg[m
gpg.x509.program=mykeyname[m
color.ui=auto[m
gpg.openpgp.program=12345678910[m
I'm still getting the same error, however.
>> ! git commit -m"all"
error: cannot run 12345678910: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object
Any advice would be so appreciated.
Thank you.
3 comentarios
Manikanta Aditya
el 12 de Abr. de 2024
The git config --global gpg.openpgp.program mykeyname command is used to specify the path to the GPG executable. If mykeyname is the name of your GPG key, this command might not be necessary.
Try ensuring that your GPG key is correctly set up in your Git configuration. You can check this by running !git config --global --list in MATLAB’s command window. The output should include user.signingkey=12345678910 if your key is set up correctly.
Sayaka Minegishi
el 12 de Abr. de 2024
Manikanta Aditya
el 13 de Abr. de 2024
Oh, then even I am not sure..
Respuestas (1)
Swastik Sarkar
el 22 de Abr. de 2024
It appears you are encountering difficulties with signing commits in your GitHub repository, due to the GPG program not being correctly configured with Git.
To address this issue directly, ensuring Git can utilize the GPG program for signing is crucial.
As @Manikanta Aditya mentioned, setting the signing key might suffice, but if gpg.program is specified, Git will attempt to use that path to access the GPG tool.
For a seamless setup, you can define the path to the GPG tool within Git's configuration using the following command:
git config --global gpg.program $(which gpg)
Executing this command sets the gpg.program globally for Git, offering a reliable solution for commit signing moving forward.
Hope this helps.
Categorías
Más información sobre Source Control en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!