Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm wondering how to pull a repo with all of the commits that have not been gc'd, if that is possible..

is it something like:

$ git clone x
$ cd x
$ git fetch origin -f

? or something else?

share|improve this question
What are you trying to accomplish? Maybe if we know why you need this, we can give you a better answer. Normally the owner of the remote repository will reference commits that they want to be fetchable. Dangling commits that haven't been gc'd are at risk to be lost at any time. – Stephen Jennings Sep 13 '11 at 14:32
up vote 2 down vote accepted

There is no command I'm aware of which says "bring down all commit objects in the remote repository, even those that are unreferenced".

You can only bring commits with a reference in the remote repository. You can do this with the command:

git fetch [remote] [remoteBranch]:[localBranch]

The remote repository will need to create a reference to any dangling commits before you can fetch them. If you have access to the remote repository, you can do this with a command like:

git fsck --lost-found

The output will show you any dangling commits. Give them a reference with git branch [branchname] [commit sha1], then you can fetch them.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .