[U-Boot] Attn Maintainers: git advise needed (how to fix messed up repo)
Mike Frysinger
vapier at gentoo.org
Tue Nov 29 05:01:36 CET 2011
On Monday 28 November 2011 22:35:24 Graeme Russ wrote:
> On Tue, Nov 29, 2011 at 2:31 PM, Mike Frysinger wrote:
> > the expected behavior of downstream users is apparently to always
> > fetch+rebase rather than fetch+merge (what "pull" normally does). this
> > is pretty unusual (and in most git circles, unforgivable as the
> > "default" workflow). but as i'm
>
> OK, so what would be a more acceptable workflow?
never rebase anything you want other people to be working off of :). the
downside is that any commit you've published cannot be modified.
one way around this is to have three branches:
- one that tracks mainline, and you only add stuff when you're going to send a
pull request to Wolfgang
- one that keeps all your "clean" patches and gets rewritten constantly (and
needs --force to publish)
- one that gets all the incremental fixes that people can pull from and always
have a consistent history, and gets merge commits
it's more work to be sure, so it's up to you how you want to develop
> And just quickly back to the problem at hand - How do I fix the 'duplicate
> commits' problem I already have?
you can either use the --force flag to push your rewritten history (in which
case everyone downstream from you also needs to rewrite their history), or fix
your history locally before pushing the update:
- fetch *your* current remote master, *not* Wolfgang's master
- normally your repo is listed as "origin" ... but you'd have to read
.git/config to find out exactly what it is ...
- save any patches you care about (git format-patch/etc...)
- reset your local master to your current remote master
$ git checkout master
$ git reset --hard origin/master
- apply any new changes you wanted to publish
$ git cherry-pick <sha1>
$ git am -3 *.patch
...whatever...
- push out your new local master branch that only has new changes compared to
the already published version
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111128/f0177992/attachment.pgp>
More information about the U-Boot
mailing list