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

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

    git clone [email protected]:jiahong888/iris-demo.git
    git config --global user.name 'jiahong888'
    git config --global user.email '[email protected]'
  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 地址是[email protected]时,push 报错:ERROR: Permission to raojiahong888/go-zero-demo.git denied to jiahong888.
    fatal: Could not read from remote repository.
    (为避免冲突,jiahong888账号下项目的仓库地址使用[email protected]时,raojiahong888账号下项目的仓库地址使用https。)

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

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

你可能感兴趣的:(本地pull, push 2个github账号的仓库)