gpt4 book ai didi

git - 使用一个 Remote pull 另一个 Remote 使用 Git

转载 作者:太空狗 更新时间:2023-10-29 14:01:50 27 4
gpt4 key购买 nike

我对 git 越来越熟悉了,但是我遇到了一些让我困惑的事情。我们在这里使用本地镜像,因为我们的线路很慢。为了指向镜子,我在 .gitconfig 中有一些常用的东西。

当我想推送时,问题就来了。看来我需要一个别名 URL 的 repo - 而不是在 .gitconfig 中重新映射的那个 - 或者我需要编辑 .gitconfig 以推送到真正的 repo (不是镜子)。

这确实是一种使用模式。我怎样才能使镜像在 pull 时无缝并在 push 时让它不碍事?

最佳答案

像这样设置一个 Remote

[remote "myrepo"]
url = mirror url here
pushurl = push url here

然后只需将分支机构上的 Remote 设置为那个 Remote 即可。

关于git - 使用一个 Remote pull 另一个 Remote 使用 Git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7420662/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com