git存储库浏览 [英] git repository browsing

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

问题描述

我感兴趣的是,我可以通过以下方式使用git进行资源库浏览:给定远程存储库
$ b


- 仅提取有关目录结构的数据在开始时的特定修订
- 根据以前获得的知识,例如(伪命令只是为了说明意图),单独提取文件:
p>

git clone --dont_get_me_repo_contents_please
//关于文件内容的信息在某处,我看到我/ cool /文件与其他人一起
git get my / cool / file

假设我不拥有该服务器(其中一个是存储远程回购)。我只能通过git客户端与它进行交互。



我只想尽可能少地使用网络传输,并且占用很小的空间。



基本上,你在github上做了什么,当你浏览一个修订版的文件,并且你看到dirs时,你点击一个文件,你就可以得到这些内容。通过网络发送的唯一信息是目录结构和您正在查看的文件的内容。
我假设它与服务器上的git repo进行交互。现在它是怎么做到的?



我不想要这样做的东西,也许只是一个例子,我想知道这是如何完成的。



我已经做了一些阅读,我觉得答案是否定的,这不能以这种形式完成。
是不是这样做的,而且某个人需要在某处检出修订版本?如果是这样,根据我的目标,我最好的选择是什么(尽量少使用网络流量,次要 - 尽量减少空间)。

对不起如果我使用git条款是滥用的(这里是n00b)。我希望我能理解。

编辑:那么MERCURIAL呢?这些东西可以用它来完成吗?

谢谢。

解决方案

你可以从一个浅的git克隆开始(比如说,历史上只有一个版本):

pre $ git clone --depth 1


I am interested if I can do repository browsing with git in the following way:

given a remote repository -fetch only data about the directory structure of a certain revision at the beginning - fetch files individually on choice given the knowledge acquired previously

for example(fake commands only to illustrate intent):

git clone --dont_get_me_repo_contents_please // the info about the file contents is somewhere and i see my/cool/file alongside with others git get my/cool/file

Supposedly I would not be owning that server (the one were the remote repo is stored). I can only interact with it through the git client.

I just want to use as little network transfer as possible and as little space.

Basically, what you do on github, when you look through the files of a revision, and you see the dirs, you click on a file and you get just those contents. The only info that gets sent over the network is the dir structure and the contents of the file you are looking at. I'm assuming it is interacting with the git repo on the server. now how does it do that?

I do not want something that does this, maybe just as an example,I want to know how this is done.

I've done some reading and I feel the answer is no, this cannot be done in this form. Is it the case that one cannot do this and one needs a checked out revision somewhere? If so, what are my best alternatives, given my objectives (use as little network traffic as possible, secondary - try to minimize space as well).

I'm sorry if my use of git terms is abusive (n00b here). I hope I got the idea across.

EDIT: What about MERCURIAL? can these things be done with it?

Thanks.

解决方案

You could start with a shallow git clone (say, only 1 revision in the history):

git clone --depth 1

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

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