How to connect to Github

23 ビュー (過去 30 日間)
Sayaka Minegishi
Sayaka Minegishi 2024 年 4 月 12 日
回答済み: Swastik Sarkar 2024 年 4 月 22 日
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 件のコメント
Sayaka Minegishi
Sayaka Minegishi 2024 年 4 月 12 日
Thank you. I'm still getting the same issue, although user.signingkey is set to my key ID shown in github.
Manikanta Aditya
Manikanta Aditya 2024 年 4 月 13 日
Oh, then even I am not sure..

サインインしてコメントする。

回答 (1 件)

Swastik Sarkar
Swastik Sarkar 2024 年 4 月 22 日
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.

カテゴリ

Help Center および File ExchangeSource Control についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by