5

I have a small problem at work.

We commit all the different projects to different remote repositories and sometimes people get confused by the names they create at 4 in the morning high on caffeine.

So my question is:

Is there a way to browse remote repositories to list all the branches?

Any help is greatly appreciated!

4

3 回答 3

3

要仅列出远程分支,请首先获取(以确保您对它们都有本地引用),然后列出它们:

git fetch
git branch -r

您可能希望在获取后执行一个git remote prune <remotename><remotename>通常是远程名称在哪里origin)以删除对已删除的远程分支的过时本地引用。

直接“浏览”远程存储库的唯一方法是登录到它所在的服务器并这样做(或设置 gitweb 或类似的)。Git 的中心思想是,您的本地副本拥有远程所做的一切。

于 2013-05-27T19:13:07.647 回答
1

git branch -a将列出所有分支机构,本地和远程跟踪。

于 2013-05-27T19:02:09.693 回答
0

如果您使用以下方式获取所有分支,git fetch --all则可以使用以下方式查看所有远程分支:

git branch -a | grep remote
于 2013-05-27T19:02:51.767 回答