具体操作:./git/gitOperation.md
1、首先关联Github和Gitee的远程仓库;
git remote add github git@github.com:IThawk/learnCode.git
git remote add gitee git@gitee.com:IThawk/learnCode.git
2、然后打开“.git”文件夹内的配置文件;接着修改remote改两个,一个Github库另一个Gitee库;
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = [email protected]:IThawk/learnCode.git
fetch = +refs/heads/*:refs/remotes/github/*
[branch "master"]
remote = origin
merge = refs/heads/master
将上述文件内容[remote "origin"]内容复制,修改origin名称,内容如下:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "github"]
url = [email protected]:IThawk/learnCode.git
fetch = +refs/heads/*:refs/remotes/github/*
[remote "gitee"]
url = [email protected]:IThawk/learnCode.git
fetch = +refs/heads/*:refs/remotes/gitee/*
[branch "master"]
remote = origin
merge = refs/heads/master
3、代码添加:
git add .
4、代码提交:
git commit .
5、代码分别Github和Gitee即可。
提交到github
git pull github master
5、代码分别提交到Github和Gitee即可。
提交到github
git push github master
提交到码云
git push gitee master
mongodb 客户端
git push -f github master