如何显示特定远程的远程分支
how to show remote branches of a specific remote
我在一个文件夹下有三个不同名称的仓库:
remote1/branch1
remote1/branch2
remote2/branch1
remote3/branch1
当我想要获取远程分支时,我只想从一个存储库执行特定的远程分支,我知道 git branch -r
向我展示了所有这些分支,但我想知道如何做 git branch -r 仅在一个提到的存储库上?
我正在尝试 git branch -r=remote1
或 git branch --remotes=remote1
但是这样是不对的,请问有没有什么办法呢?
我只有一个目录,在那个目录里面我有不同的遥控器
存储库。
这里有更多信息:
$ git remote -v
remote1 https://url/rep1.git (fetch)
remote1 https://url/rep1.git (push)
remote2 https://url/rep2.git (fetch)
remote2 https://url/rep2.git (push)
remote3 https://url/rep3.git (fetch)
remote3 https://url/rep3.git (push)
一种快速的方法是在 git 命令之后使用 grep
,如下所示:
git branch --remote | grep rep2
我在一个文件夹下有三个不同名称的仓库:
remote1/branch1
remote1/branch2
remote2/branch1
remote3/branch1
当我想要获取远程分支时,我只想从一个存储库执行特定的远程分支,我知道 git branch -r
向我展示了所有这些分支,但我想知道如何做 git branch -r 仅在一个提到的存储库上?
我正在尝试 git branch -r=remote1
或 git branch --remotes=remote1
但是这样是不对的,请问有没有什么办法呢?
我只有一个目录,在那个目录里面我有不同的遥控器 存储库。
这里有更多信息:
$ git remote -v
remote1 https://url/rep1.git (fetch)
remote1 https://url/rep1.git (push)
remote2 https://url/rep2.git (fetch)
remote2 https://url/rep2.git (push)
remote3 https://url/rep3.git (fetch)
remote3 https://url/rep3.git (push)
一种快速的方法是在 git 命令之后使用 grep
,如下所示:
git branch --remote | grep rep2