Actually, I did do a "-f" push. If I don't, it complains in the usual way that 
it's not a fast-forward.

Thanks for the explanation about branch behavior, but it must not be impossible 
because it happened to me. I was able to push a branch from a completely new 
repository (~10MB) with no history onto one with a year of history (~155MB) and 
Heroku is showing a repository size of 165MB. 

I did several tests using a local repository, with all kinds of pushes, prunes, 
etc. and I just can't find a way to reduce the size of the repository itself.

(Sorry about the top-posting. I'm new to this. This time I replied from my 
email client, so I'll see what happens.)



________________________________
From: Konstantin Khomoutov <khomou...@gmail.com>
To: Git for human beings <git-users@googlegroups.com>
Sent: Wed, June 9, 2010 7:24:52 AM
Subject: [git-users] Re: re-init remote without access to the server

On Jun 9, 5:53 pm, Dan Z <dza...@yahoo.com> wrote:

> Thanks for the reply. However, this doesn't work. If I try to push
> nothing, I get this error:
>
> -----> Heroku receiving push
>  !     Heroku push rejected due to an unrecognized error. Please try
> again later.
>
> error: hooks/pre-receive exited with error code 2
> To g...@heroku.com:myapp.git
>  ! [remote rejected] master (pre-receive hook declined)
> error: failed to push some refs to '....@heroku.com:myapp.git'

OK, so try the same with the "-f" command-line option, like this:
$ git push -f origin :master :slave
That is, try to force the push.
They could have also prevented forced pushes, but let's try first.

> When I push a branch with a different history (which is what I already
> tried), it simply ADDS to the history. It doesn't replace what was
> already there.
I can't beleive that. Possibly you misunderstand what "different
history" does really stand for.
Different histories mean something like this:
1) Your local branch has the history record like this:
   [...->A->B]->C->D
with the tip commit D;
2) Your remote branch has the history record like this:
   [...->A->B]->X->Y->Z
with the tip commit Z (the bits between [ and ] are common between
branches),
so the two histories have diverged since commit "B" (which naturally
can happen if someone pushed X-Z line while you were hacking away
implementing C-D line).
The fact is, in Git, it's impossible to "add" C-D upon X-Z when you
push, this simply can't happen, but the --force (-f) option can be
used to direct Git's remote part to just *throw away* commits X-Z and
replace them with C-D you're pushing. That's what I suggested to do.
If your local branch does not have any common history with remote one,
such forced push will replace the whole history record of the remote
branch.

P.S.
Please don't top-post. This thrashes the discussion flow, which sucks.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.


      

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.

Reply via email to