git同时推送到gitee和github

158 阅读1分钟
  1. 新建github仓库,然后在gitee导入github仓库

image.png

  1. 导入成功后先右键进入git Bash Here,然后git init初始化仓库,git add . ,git commit -m 'first commit' 注意,必须先绑定ssh,如果没有,可以查看本地的git的ssh,
cd ~/.ssh
cat ~/.ssh/id_rsa.pub
  1. 如果没有就重新生成,一直回车就行了
ssh-keygen
cat ~/.ssh/id_rsa.pub
  1. 添加到gitee上的ssh

image.png 5. 打开.git找到config,添加两个url,分别是你的gitee和github的地址

image.png
6. 最后直接push就会同时推送到gitee和github上面了,成功的图示。

image.png