In git, we can push a remote branch to another remote like this:
> 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
So on "@foo1.com:a/a", we can see it got the remote of "foo2.com:b/b", by using the git branch -va
command:
* master 7c6051f foo
remotes/other/master 38a5a1b bar
If we just use git branch -v
this remote branch wouldn't appear.
However I can't think how this is useful. There is no way for my local to interact with this on foo1.com:a/a
right? Could someone gives a potential use case for this?
Also could this somehow be disabled with some git configuration?