git同时提交到2个仓库gitee github

1.进入项目根目录

git同时提交到2个仓库gitee github_第1张图片

2.点击查看,显示隐藏文件夹

git同时提交到2个仓库gitee github_第2张图片

出现git文件夹

git同时提交到2个仓库gitee github_第3张图片

3.进入.git文件夹

git同时提交到2个仓库gitee github_第4张图片4.

4.编辑config

原文件

git同时提交到2个仓库gitee github_第5张图片

修改后

git同时提交到2个仓库gitee github_第6张图片

代码如下

[core]
   repositoryformatversion = 0
   filemode = false
   bare = false
   logallrefupdates = true
   symlinks = false
   ignorecase = true
[submodule]
   active = .
[remote "origin"]
   url = https://gitee.com/stylesmile/snow.git
   fetch = +refs/heads/*:refs/remotes/origin/*
   url = https://github.com/stylesmile/snow.git
   
[branch "master"]
   remote = origin
   merge = refs/heads/master
   
[remote "github"]
    url = https://github.com/stylesmile/snow.git
    fetch = +refs/heads/*:refs/remotes/gitee/*
    tagopt = --no-tags

再次push ,就会同时提交到2个仓库

你可能感兴趣的:(git)