Re: Pushing an --amend-ed commit [and a git-merge-theirs strategy]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2 Jun 2008, at 15:55, Paolo Bonzini wrote:
1) Right, changes all done and committed. Push to public repo.
2) Bugger, missed out an obvious one-liner in a Makefile. Make change and --amend that last commit. 3) Push to public repo again... Ah, "Not a strict subset" error, can't push... It's obvious (I think) to me why I get this error - the commit now has a different hash so it looks like it would be the wrong thing to do to allow the push as far as git is concerned. Right? So, is it safe to "use the --force" in this instance when pushing? This should just replace the old commit with the --amended commit with no side-effects, shouldn't it?

Yes, but it would screw up other people that pulled from you.

Ah yes, forgot about that...

If that's an issue (it most likely is, unless you're just pushing just to your own mirror repository)

It's not an issue right now as I'm still experimenting, but it certainly will be when I let others lose on this stuff. It's really not something I see myself doing a lot - I usually test a lot more thoroughly before publishing to a public repo...

it is better if you do it the other way round: adding your commits on top of origin^, starting from the one that fixed a typo. In other words, make the history look like you hadn't used --amend.

<snip big explanation and code>

Thanks very much for the code and method. It goes over my head a bit right now, but I'll think on it and try it and see how I get on! A lot of what git can do scares me a bit still - mainly because it's me driving it...

Thanks also to the other people who answered me!

Cheers,
Rob

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux