使用git将code同时提交github,gitee,coding

现在的代码托管平台层出不穷,从最初的国外的github,发展到由开源中国创办的gitee,再到现在的coding

如果我们想要将同一份code提交到这些不同代码托管平台的仓库,可以使用修改config文件夹的方法,具体操作方法如下:

添加到github仓库的配置命令:

  git git remote add origin https://github.com/w4ctech/hellogit.git
复制代码

添加到gitee仓库的配置命令:

git remote set-url --add origin https://gitee.com/w4ctech/hellogit.git
复制代码

添加到coding仓库的配置命令:

 git remote set-url --add origin  https://git.coding.net/w4ctech/hellogit.git
复制代码

或者直接修改当前.git文件夹下

config文件内容为

    [core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[remote "origin"]
    url = https://git.coding.net/w4ctech/hellogit.git
    fetch = +refs/heads/*:refs/remotes/origig/*
[remote "origin"]
    url = https://git.coding.net/w4ctech/hellogit.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = https://github.com/w4ctech/hellogit.git
    url = https://gitee.com/w4ctech/hellogit.git
复制代码


修改完成后可使用 git remote -v

命令查看远程仓库信息
三步曲将code push

切换到仓库查各个仓库的code:



                                                          


                                               Code submission success


转载于:https://juejin.im/post/5a9bf04f518825557a2e6e99

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值