How to connect to Github
31 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Swastik
on 22 Apr 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.
0 Comments
See Also
Categories
Find more on Source Control Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!