我的git远程回购看起来是这样的:
$ git remote -v
origin https://github.com/jiangxiaoqiang/dolphin-scripts.git (fetch)
origin https://github.com/jiangxiaoqiang/dolphin-scripts.git (push)
origin https://gitee.com/jiangxiaoqiang/dolphin-scripts.git (push)现在我希望默认情况下从gitee获取,如何将提取url更改为gitee。
发布于 2020-06-07 04:12:57
试一试
git remote add origin https://gitee.com/jiangxiaoqiang/dolphin-scripts.git --mirror=fetchde here如果您已经有了源,您可能必须清除远程名称和readd (3个命令):
git remote origin remove
git remote add origin https://gitee.com/jiangxiaoqiang/dolphin-scripts.git
git remote set-url --push origin https://github.com/jiangxiaoqiang/dolphin-scripts.git发布于 2020-06-07 05:36:37
正如詹森·菲利普斯所说,你必须首先做到:
git remote remove origin它将删除源remote和与其关联的URL。接下来要做的是:
git remote add origin https://gitee.com/jiangxiaoqiang/dolphin-scripts.git它将添加一个名为origin的新远程,它与gitee URL相关联。现在添加另一个远程(让我们称之为extra),它将被用于推送到GitHub
git remote add extra https://github.com/jiangxiaoqiang/dolphin-scripts.git现在,您可以执行git push extra来将更改推送到GitHub和git fetch origin或git pull origin,以便分别从Gitee获取和提取更改。
最好的
https://stackoverflow.com/questions/62240722
复制相似问题