Home >Development Tools >git >How to synchronize Github with Gitee?
How to synchronize Github with Gitee?
First associate the remote repositories of Github and Gitee;
git remote add github git@github.com:code/demo.git git remote add gitee git@gitee.com:code/demo.git
Then open the configuration file in the ".git" folder; then modify the remote to change two, one Github repository and the other Gitee library;
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = git@github.com:chloneda/demo.git fetch = +refs/heads/*:refs/remotes/github/* [branch "master"] remote = origin merge = refs/heads/master
Copy the content of the above file [remote "origin"] and modify the origin name. The content is as follows:
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "github"] url = git@github.com:chloneda/demo.git fetch = +refs/heads/*:refs/remotes/github/* [remote "gitee"] url = git@gitee.com:chloneda/demo.git fetch = +refs/heads/*:refs/remotes/gitee/* [branch "master"] remote = origin merge = refs/heads/master
The final code can be submitted to Github and Gitee respectively.
Submit to github
git push github master
Submit to Code Cloud
git push gitee master
Recommended tutorial: "Git Tutorial"
The above is the detailed content of How to synchronize Github with Gitee?. For more information, please follow other related articles on the PHP Chinese website!