Git同时push到Gitee和Github仓库 与 Github对密码认证的支持于2021年8月13日被删除

Git同时push到Gitee和Github仓库

修改 .git/confit 文件,如下,然后就可以一条push命令让Gitee和Github仓库同时同步了

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

Github对密码认证的支持于2021年8月13日被删除

Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

意思很明确,2021年8月13日后提交代码需要用token代替账号密码进行鉴权

https://github.com/xxx/Test.git
=> 改为
https://你的token@github.com/xxx/Test.git
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容