【发布时间】:2019-03-17 05:01:55
【问题描述】:
在 git 中,我们可以像这样将一个远程分支推送到另一个远程:
> git clone git@foo1.com:a/a
> cd a
> git remote add other git@foo2.com:b/b
> git fetch --all
# ...
> git push origin other/master
Counting objects: 107, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (66/66), done.
Writing objects: 100% (107/107), 2.11 MiB | 0 bytes/s, done.
Total 107 (delta 52), reused 87 (delta 33)
remote: Resolving deltas: 100% (52/52), completed with 8 local objects.
To foo1.com:a/a
* [new branch] other/master -> other/master
所以在“@foo1.com:a/a”上,我们可以看到它得到了“foo2.com:b/b”的远程,通过使用git branch -va命令:
* master 7c6051f foo
remotes/other/master 38a5a1b bar
如果我们只使用git branch -v,这个远程分支就不会出现。
但是我想不出这有什么用。我的本地人无法在foo1.com:a/a 上与此进行交互,对吗?有人可以为此提供一个潜在的用例吗?
也可以通过一些 git 配置以某种方式禁用它吗?
【问题讨论】:
标签: git branch git-branch