gpt4 book ai didi

git push 只能在 `sudo` 下工作

转载 作者:太空宇宙 更新时间:2023-11-03 13:25:16 29 4
gpt4 key购买 nike

当我尝试推送一个git仓库到github时:

julia_proj git:(master) git push -u origin master
fatal: unable to access 'https://github.com/nickleeh/julia_proj.git/': SSL certificate problem: unable to get local issuer certificate

我尝试使用 sudo:

julia_proj git:(master) sudo git push -u origin master
[sudo] password for nick:
Username for 'https://github.com': nickleeh
Password for 'https://nickleeh@github.com':
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 373 bytes | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To https://github.com/nickleeh/julia_proj.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.

我很惊讶它在 sudo 下工作,(它还要求我输入 github 帐户名和密码。)这里有什么问题以及如何在不使用 的情况下进行设置须藤?

软件环境:

➜  julia_proj git:(master) uname -a
Linux nick-thinkpad 4.2.5-1-ARCH #1 SMP PREEMPT Tue Oct 27 08:13:28 CET 2015 x86_64 GNU/Linux
➜ julia_proj git:(master) git --version
git version 2.6.4
➜ julia_proj git:(master)

最佳答案

一旦您确定了您正在使用的证书文件(如 Guildencrantz 所述):

 curl -sv https://github.com/ 2>&1 >/dev/null | grep 'CAfile'

做(没有须藤)

cd /path/to/your/local/repo
git config http.sslCAInfo /path/to/certificates

如果推送有效,请为所有 repo 设置:

cd /any/path/you/want
git config --global http.sslCAInfo /path/to/certificates

关于git push 只能在 `sudo` 下工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34477189/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com