Getting remote git commit log without local copy

19

1

I want to get a copy of the commit log from a remote GIT repository without cloning/pulling it to my local machine and using only SSH. Is this possible?

For example, I want to do something like:

git log -- git@github.com/twitter/bootstrap.git

This will need to be generic. I know about the GitHub API (that was just an example); the command needs to work with any GIT repo that can be accessed over SSH.

Smudge

Posted 2011-09-29T23:31:30.440

Reputation: 593

Answers

6

is this possible?

In short: no, not exactly. However, https://stackoverflow.com/questions/1178389/browse-and-display-files-in-a-git-repo-without-cloning has a nice alternative to running an SSH command remotely on the machine where the git repository lives.

It won't work with any git repo, just those where you are able to execute SSH commands against.

vcsjones

Posted 2011-09-29T23:31:30.440

Reputation: 2 433

0

It doesn't seem so (at least easily right now -- maybe I could extend Git to make this possible).

I wrote a small script which makes a shallow clone into a temporary project, then runs git log and then removes the directory again. THe shallow cloning should hopefully be fast.

The script is here: https://github.com/albertz/helpers/blob/master/git-log-remote.sh

Albert

Posted 2011-09-29T23:31:30.440

Reputation: 5 059

If you make a shallow clone with depth of 1, you'll only have the most recent commit in the log. – Mixologic – 2014-08-11T04:57:22.320