Git request for remote log and changes

I need to get data about changes, file changes and the number of lines of code that were changed without repo cloning, the only thing I have is the repo url. The only command I found to view the remote changes is git ls remote, but the output is too bad. How can i do this?

+4
source share
3 answers

It is not possible to accomplish what you requested using only the Git protocols.

Depending on how the repository is hosted, you may receive some information through the web interface. gitweb is distributed via Git, and large hosting services often have their own web interfaces.


  • Gitweb example: git.git view commit tagged 1.7.3.2
    • top links
      • "log" or "shortlog" shows the history leading to commit
      • "commitdiff" to access diffs against parent (s)
      • merge / parent abbreviated name of the object (hexadecimal string) moves to this parent
    • links for parents
      • The diff link shows the difference from this parent
      • the commit link moves to this parent
    • "tree" link shows files written to commit
    • links to each file
      • "diff" ("diffN" for merges) shows diff of this file only
      • "blob" shows the contents of the file
      • "history" shows the commits leading to the current commit that modify this file.

  • GitHub example: git.git view commit tagged 1.7.3.2
    • The tab โ€œRecordsโ€ shows the history
      • "commit" / "parent" the abbreviated name of the object (hexadecimal string) takes you to commit; it shows
        • files that have been modified for this
          • green and red squares on the right show the number of added / deleted lines in each file
        • differences for fixing
          • "View file" shows the entire file since it was committed to this commit
            • "raw" view / download file
            • โ€œblameโ€ indicates the most recent commit to modify each line of this file.
            • "history" shows the commits leading to the current commit that changed this file.

If you are going to do any significant operations in history, it is probably worth cloning the repository (and this is most likely the only way if the hosting service does not have any web interface). You will need to use some disk space, but your research will not be limited to what the web interface provides, and it will be much faster.

Another option is the git archive ; it is an additional server, so it cannot be enabled for the server that hosts your repository. It allows you to download archives (e.g. tar or zip files) of individual trees. Technically, you can extract such archives and manually distinguish them to get the information you use, but it will most likely be more cumbersome and less efficient than just cloning the repository and using ordinary tools (i.e. git log with --stat or --numstat with or without -m / -c / --cc ).

+6
source

If your repository URL is for an ssh connection, you can send a remote log command via ssh, for example.

If you could clone using the command:

 git clone username@host :/path/to/repository.git 

Then you should be able to issue a log command using:

 ssh username@host git --git-dir /path/to/repository.git log 
+2
source

If you have access to the server, you can run the local git log locally on the server, analyze the data and send the aggregated result.

+1
source

All Articles