Set git to push gitee and GitHub remote warehouses at the same time

Hou fachao 2021-10-14 06:23:44

Because at home github Often inaccessible , At the same time, support domestic enterprises , So I recently started using gitee, But also want to push the project synchronously , I don't want to push it manually every time 2 Time .

  1. Get into .git Under the table of contents , open config file , The default file contents are as follows
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://gitee.com/geekidentity/showcase.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
  1. Just in [remote "origin"] Add other to push git Address , for example github Or your own gitlab

url = https://github.com/geekidentity/showcase.git

The editing is completed as follows :

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://gitee.com/geekidentity/showcase.git
url = https://github.com/geekidentity/showcase.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master

Push again at this time git push, You will press url Push... In sequence .

Please bring the original link to reprint ,thank
Similar articles

2021-10-14

2021-10-14

2021-10-14

2021-10-14

2021-10-14

2021-10-14

2021-10-14

2021-10-14

2021-10-14

2021-10-14

2021-10-14