Romain Pouclet
Romain Pouclet

Reputation: 874

Fetch changesets from a remote Git repository

I'd like to fetch changesets (to display them somewhere) from a git repository w/o cloning it on my local machine, just like svn does (svn log http://...). Is it something you can do using git? I've looked into the git log documentation but I couldn't find what I needed.

Thanks!

Upvotes: 2

Views: 932

Answers (3)

poke
poke

Reputation: 387667

You can work with remote repositories without cloning the whole repository, yes. However you are limited in what you do:

To inspect a repository for available branches:

git ls-remote git://url/to/repository.git

To fetch a single branch:

git fetch git://url/to/repository.git branch

This will fetch the branch as FETCH_HEAD you then need to checkout that branch, and can save it to a local branch (otherwise you don't have any direct reference to its head):

git checkout FETCH_HEAD
git checkout -b my-external-branch

If you plan to work with an external repository more often, it makes sense to add it as a remote (even if you don't plan to fetch everything):

git remote add ext-repository git://url/to/repository.git

Then you can either fetch the whole repository:

git fetch ext-repository

or again just single branches:

git fetch ext-repository branch

Upvotes: 3

khmarbaise
khmarbaise

Reputation: 97399

What about

git log --name-status

looks more or less like svn log ...or

git log -5 --name-status

Upvotes: -1

Bombe
Bombe

Reputation: 83852

No, Git does not deal in changesets, you have to clone the repository before you can use it. The project in question might have a web interface for the repository which might allow you to create a diff between two arbitrary versions.

Upvotes: 3

Related Questions