github与gitee代码同步push教程


github与gitee代码同步push教程

步骤1:

在gitee在已经有仓库
复制该仓库的 https://gitee.com/*******.git 的https地址

步骤2:

选择Import repository

步骤3:

``URL 输入刚刚gitee上的 https://gitee.com/*******.git`

fejxc/写你在github上的仓库名

然后点击 Begin import 即可

步骤4:

1.先将gitee项目的代码克隆到本地电脑

2.然后修改config文件 文件在 .git/concig

3.修改如下

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
[remote "origin"]
    # github
    url = git@github.com:*****.git  #add code
    # gitee
    url = https://gitee.com/*****.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]  #add code
    remote = origin
    merge = refs/heads/master

步骤5:

验证代码:

git add .
git commit -m "init"
git push

成功图示:


文章作者: 孙昀
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 孙昀 !
评论
  目录