美文网首页
公司内网挂代理上github

公司内网挂代理上github

作者: NYK宁彦科 | 来源:发表于2018-05-10 13:55 被阅读0次

公司内网挂代理GIT

环境

公司具有代理服务器,win7环境下连接不上github服务器上的远程库.

软件

win7下使用的的是git bash 软件,可以当做linux的命令行使用

配置

1.设置根文件夹

2.在bash中进入根文件夹

3.在github中添加本机的公钥文件

ssh-keygen -t rsa -C "youremail@example.com"

直接回车,使用默认值即可.id_rsa是私钥,id_rsa.pub是公钥

4.设置git全局的用户名和密码.

git config --global user.email xxx
git config --global user.name xxx

5.设置全局的代理服务器

git config --global  http.proxy=http://proxy3.bj.petrochina:8080

6.如果有报错,可以在.ssh文件夹下添加config文件

1
Host github.com  
User 2573270182@qq.com 
Hostname ssh.github.com  
PreferredAuthentications publickey  
IdentityFile ~/.ssh/id_rsa  
Port 443

正常提交

git add -A
git commit -m "update"

相关文章

网友评论

      本文标题:公司内网挂代理上github

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