本地pull, push 2个github账号的仓库

jiahong -
本地pull, push 2个github账号的仓库
记录下本地git clone, git push 2个github账号的repository, git push 到另一个github账号的repository报错(fatal: unable to access 'https://github.com/raojiahong...': Failed to connect to github.com port 443: Timed out)的解决办法。git 操作步骤:

提前生成了jiahong888账号的publickey,执行如下代码clone iris-demo,项目,账号,邮箱需替换成自己的:

git clone git@github.com:jiahong888/iris-demo.git
git config --global user.name 'jiahong888'
git config --global user.email 'jiahong888@qq.com'

修改iris-demo项目的代码,可正常提交:

git commit -m 'comment'
git push

clone raojiahong888账号下的项目:

git clone https://github.com/raojiahong888/go-zero-demo.git

修改go-zero-demo项目的代码,commit然后push:

git commit -m 'comment'
git push

当remote 地址是https时,push 报错: fatal: unable to access 'https://github.com/raojiahong...': Failed to connect to github.com port 443: Timed out.
当remote 地址是git@github.com时,push 报错:ERROR: Permission to raojiahong888/go-zero-demo.git denied to jiahong888.
fatal: Could not read from remote repository.
(为避免冲突,jiahong888账号下项目的仓库地址使用git@github.com时,raojiahong888账号下项目的仓库地址使用https。)

通过取消全局代理, 解决(Failed to connect to github.com port 443: Timed out)问题 :

git config --global --unset http.proxy
git config --global --unset https.proxy
特别申明:本文内容来源网络,版权归原作者所有,如有侵权请立即与我们联系(cy198701067573@163.com),我们将及时处理。

Tags 标签

gitgithubrepository

扩展阅读

加个好友,技术交流

1628738909466805.jpg