1.进入项目根目录
cd /www/repo
2.如果没有初始化则请输入命令完成初始化
git init
3.如果已配置过git远程仓库,请移除
git remote rm origin
4.依次添加多个远程仓库地址
git remote add github git@github.com:org/repo.git
git remote add gitee git@gitee.com:org/repo.git
5.配置当前项目的用户名和邮箱
git config user.name Tom
git config user.email tom@github.com
6.查看.git/config配置信息
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[branch "master"]
[remote "github"]
url = git@github.com:org/repo.git
fetch = +refs/heads/*:refs/remotes/github/*
[remote "gitee"]
url = git@gitee.com:org/repo.git
fetch = +refs/heads/*:refs/remotes/