Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 down vote accepted
+50

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.