两个空代码仓库
如果是两个仓库都是空的,就直接在 .git/config 中添加远端地址
[remote "origin"]
url = https://github.com/younglaker/octjs.git
url = https://git.coding.net/laker/octjs.git #添加新地址
fetch = +refs/heads/*:refs/remotes/origin/*
地址是配好了,但是还要注意分支一致。我这里都用master,就不会有问题。
非空代码仓库
假设Github中使用了一段时间,想在Coding里备份一个,要想把两边仓库同步到一致的状态。
线到Coding新建仓库,获得地址后, .git/config 中添加Coding的远端地址,这里我命名为coding:
[remote "origin"]
url =