美文网首页
【git】fatal: unable to access/Fai

【git】fatal: unable to access/Fai

作者: AntiGravity | 来源:发表于2022-12-06 16:55 被阅读0次

如果有proxy,可以对github.com设置proxy(最好不要全局)。

方式一,输入命令:
git config --global http.https://github.com.proxy http://127.0.0.1:7890 #端口号取决于软件
git config --global https.https://github.com.proxy https://127.0.0.1:7890

注意:不要设置socks5,它授权会失败,无法通过账号密码授权。

方式二,更改.gitconfig(win在用户文件夹下):
[http "https://github.com"]
    proxy = http://127.0.0.1:7890
[https "https://github.com"]
    proxy = http://127.0.0.1:7890
附:git常规创建仓库方式
  1. 进入代码文件夹,右键git bash
  2. 输入
git init
git add .
git commit -m "something"
  1. 在git或gitee创建空仓库,复制地址得到address
git remote add origin "address"
git push -u origin master
  1. 如之前未配置过username和password,需要配置
git config --global user.name [username] # 不需引号
git config --global user.email [email]
  1. 如origin已被占用,可以先删除旧的origin
git remote show origin #查看旧的origin
git remote remove origin #删除
  1. 或者单纯地换一个名字,别用origin了……

相关文章

网友评论

      本文标题:【git】fatal: unable to access/Fai

      本文链接:https://www.haomeiwen.com/subject/wtxgfdtx.html