同時提交代碼到github 和 碼雲

設置全局賬戶

git config --global user.name “賬戶名”
git config --global user.password “密碼

修改.git/config文件,配置github 和 碼雲的倉庫地址

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

提交更新步驟

1、本地提交 更新
    git add .
    git commit -m "update"

2、分別提交到github  碼雲
    git push github master
    git push gitee master
    
## 更新步驟:
    #從github拉取更新
    git pull github master
    #從碼雲拉取更新
    git pull gitee master

參考:https://www.jianshu.com/p/1b2ebf3b8cc1

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章