记录下本地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 操作步骤:

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

    git clone git@github.com:jiahong888/iris-demo.gitgit config --global user.name 'jiahong888'git config --global user.email 'jiahong888@qq.com'
  2. 批改iris-demo我的项目的代码,可失常提交:

    git commit -m 'comment'git push
  3. clone raojiahong888账号下的我的项目:

    git clone https://github.com/raojiahong888/go-zero-demo.git
  4. 批改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。)

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

    git config --global --unset http.proxygit config --global --unset https.proxy