zuhao
zuhao

Reputation: 129

Is it possible to get remote git repo's info without fetching it first?

I'm trying to get various information (such as author, last committer, last commit msg, etc) from a list of remote git repos using Ruby. So far I can find two gems for the task, Grit and Ruby-git, and Ruby-git seems to be better at handling remote repos.

However, I am wondering if it is possible to get such information without fetching each of the repo first? The list I'm working on can get very long, thus fetching all of them doesn't seem to be a feasible choice.

Upvotes: 3

Views: 191

Answers (2)

jsageryd
jsageryd

Reputation: 4633

This is not a perfect solution; but it will at least reduce the amount of data being transferred if you are only interested in the latest history.

git clone --no-checkout --depth=1 <repository>

(adapt to Ruby as needed)

Upvotes: 2

jthill
jthill

Reputation: 60305

For arbitrary repos, no, but it'd be easy enough to write hooks that maintain your report at a dedicated tag -- the sample hooks send emails, it's an easy change.

Upvotes: 0

Related Questions