2

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!

Romain Pouclet
  • 864
  • 2
  • 8
  • 17
  • See also [Browse and display files in a git repo without cloning](http://stackoverflow.com/questions/1178389/browse-and-display-files-in-a-git-repo-without-cloning) – CharlesB Mar 30 '11 at 11:49

3 Answers3

3

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.

Bombe
  • 81,643
  • 20
  • 123
  • 127
3

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
poke
  • 369,085
  • 72
  • 557
  • 602
-1

What about

git log --name-status

looks more or less like svn log ...or

git log -5 --name-status
khmarbaise
  • 92,914
  • 28
  • 189
  • 235