Git远程日志和更改请求 [英] Git remote log and changes request

查看:102
本文介绍了Git远程日志和更改请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要接收有关修订,文件更改和代码行数量更改的数据,而不克隆回购,我唯一拥有的是回购网址。我发现查看远程更改的唯一命令是,但它的输出太差。我怎么做到这一点?

解决方案

没有办法只用Git协议来做问题。



根据存储库的托管方式,您可以通过 web界面 gitweb 与Git一起发布,而大型托管服务通常会他们自己的网页界面。





  • gitweb示例: git.git查看提交已标记为1.7.3.2
      $

      • log或shortlog显示导致提交的历史记录
      • commitdiff访问针对父级的差异

      • 合并/父级缩写对象名称(十六进制字符串)移至该父级


    • 每个父链接

      • diff链接显示针对该父级的差异
      • 提交链接移至该父级


    • tree链接显示提交中捕获的文件 每个文件链接

      • diff(合并的diffN)仅显示该文件的差异

      • blob显示文件内容
      • >
      • history显示通向当前提交的提交以修改此文件


  • >






  • GitHub示例: git.git查看提交已标记为1.7.3.2

    • 提交选项卡显示历史

      • 提交/父母缩写对象名称(十六进制字符串)将带您到提交;它显示

        • 为该提交更改的文件

          • 右侧的绿色和红色方块显示行数在每个文件中添加/删除

        • 提交的差异

          • 文件显示整个文件,因为它在该提交中被捕获

            • 原始查看/下载文件 最近一次提交更改此文件的每一行

            • history显示通向当前提交的提交以更改此文件




    • >





    如果您打算在历史中进行任何重要的挖掘,它可能是值得的克隆存储库(如果托管服务没有某种类型的Web接口,它很可能只是方式)。您将不得不使用一些磁盘空间,但您的调查不会受到Web界面提供的限制,并且速度会更快。另外一种可能性是 git archive ;它是一个可选的服务器,因此可能不会为托管存储库的服务器启用。它允许您下载单个树木的档案(例如tar或zip文件)。从技术上讲,你可以提取这些档案并手工比较它们以获得你之后的信息,但这可能比克隆存储库和使用普通工具(即 git log - stat - numstat 有或没有 - m / -c / - cc )。


    I need to receive the data about revisions, file changes and number of code lines changed without cloning the repo, the only thing I have is a repo url. The only command I found for viewing remote changes is git ls remote, but it's output is too poor. How can I do that?

    解决方案

    There is no way to do what you asked using only the Git protocols.

    Depending on how the repository is hosted, you may be able to get some of the information via a web interface. gitweb is distributed with Git and big hosting services often have their own web interfaces.


    • gitweb example: git.git viewing commit tagged 1.7.3.2
      • top links
        • "log" or "shortlog" shows the history leading to the commit
        • "commitdiff" to access diffs against the parent(s)
        • merge/parent abbreviated object name (hex string) moves to that parent
      • per-parent links
        • "diff" link shows the diff against that parent
        • "commit" link moves to that parent
      • "tree" link shows the files as captured in the commit
      • per-file links
        • "diff" ("diffN" for merges) shows the diff of only that file
        • "blob" shows the contents of the file
        • "history" shows the commits leading to the current commit that modify this file

    • GitHub example: git.git viewing commit tagged 1.7.3.2
      • "Commits" tab shows the history
        • "commit"/"parent" abbreviated object name (hex string) takes you to the commit; it shows
          • the files that changed for that commit
            • the green and red squares on the right show the number of lines added/deleted in each file
          • the diffs for the commit
            • "View file" shows the whole file as it was captured in that commit
              • "raw" view/downloads the file
              • "blame" shows the most recent commit to change each line of this file
              • "history" shows the commits leading to the current commit that changed this file

    If you are going to be doing any significant digging around in the history it will probably be worth cloning the repository (and it is likely to be the only way if the hosting service does not have a web interface of some kind). You will have to use some disk space but your investigation will not be limited to what the web interface provides and it will be much faster.

    One other possibility is git archive; it is an optional server, so it may not be enabled for the server hosting your repository. It allows you to download archives (e.g. tar or zip files) of individual trees. Technically, you could extract such archives and manually diff them to derive the information you are after, but it would likely be more cumbersome and less efficient than just cloning the repository and using the normal tools (i.e. git log with --stat or --numstat with or without -m/-c/--cc).

    这篇关于Git远程日志和更改请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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