Git - 浏览远程存储库 [英] Git - Browse remote repository

查看:123
本文介绍了Git - 浏览远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将所有不同的项目提交给不同的远程存储库,有时候人们会因它们在那么我的问题是:

有没有一种方法可以浏览远程存储库以列出所有的分支机构?



任何帮助非常感谢!

解决方案

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

  git fetch 
git分支-r

您可能希望在获取后执行 git remote prune< remotename> (其中< remotename> 是远程的名称(通常是 origin ),用于删除已删除的远程分支的过时本地引用。 p>

直接浏览远程存储库的唯一方法是登录到它所驻留的服务器并执行此操作(或者设置gitweb或类似)。 Git的核心思想是您的本地副本拥有远程功能。


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!

解决方案

To list only remote branches, first fetch (to ensure you have a local reference to them all), then list them:

git fetch
git branch -r

You may wish to, after fetching, do a git remote prune <remotename> (where <remotename> is the name of your remote—usually origin) to remove obsolete local references to remote branches that have been deleted.

The only way to directly "browse" a remote repository is to log into the server it resides on and do so (or setup gitweb or similar). Git is centered around the idea that your local copy has everything the remote does.

这篇关于Git - 浏览远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆