HEADS UP: svn->git transition

Peter Kjellerstedt peter.kjellerstedt at axis.com
Thu Apr 30 11:44:07 UTC 2009


> -----Original Message-----
> From: Thierry Reding [mailto:thierry.reding at avionic-design.de]
> Sent: den 30 april 2009 13:37
> To: Bernd Schmidt
> Cc: Peter Kjellerstedt; busybox at busybox.net; uclibc at uclibc.org;
> buildroot at uclibc.org
> Subject: Re: HEADS UP: svn->git transition
> 
> * Bernd Schmidt wrote:
> > Peter Kjellerstedt wrote:
> >>> -----Original Message-----
> >>> From: uclibc-bounces at uclibc.org [mailto:uclibc-bounces at uclibc.org]
> On
> >>> Behalf Of Mike Frysinger
> >>> Sent: den 29 april 2009 18:59
> >>> To: uclibc at uclibc.org
> >>> Cc: busybox at busybox.net; buildroot at uclibc.org
> >>> Subject: Re: HEADS UP: svn->git transition
> >>>
> >>> On Wednesday 29 April 2009 12:52:29 Bernd Schmidt wrote:
> >>>> Bernhard Reutner-Fischer wrote:
> >>>>> git push -v --thin git+ssh://$USERNAME@uclibc.org/srv/git/uClibc.git
> >>>> Huh.  Does git really work if multiple people push to the same
> >>>> repository?  That's news to me.  All the online examples seem to
> >>>> suggest using git push as a means to provide a git-pullable
> >>>> repository for others, but not for writing to a central
> >>>> repository.
> >>> afaik it should work fine.  if you try to push and someone else
> >>> already has, you'll get the typical "rejecting non-fast forward
> >>> update".
> >
> > That seems to be correct, I've reproduced this locally with some test
> > repositories.
> >
> >> It works fine, but requires some discipline. E.g., the GStreamer
> >> project uses git this way. One of the important things to remember
> >> when using a central git repository in this way is
> >> to always rebase the local repository before pushing. Otherwise
> >> you will end up with a lot of unnecessary merges.
> >
> > So what are the steps once you get the error message mentioned above?
> > I "git pull"ed after that and ended up with a merge.
> 
> You use "git fetch" to update the local repository with the latest
> changes from the remote repository, then use "git rebase origin/master" 
> to rebase all local commits onto the master branch of the origin 
> repository. origin/master can of course be substituted with any 
> other branch as well.
> 
> After that you can "git push" your new branch to the remote repository.
> 
> > Bernd
> 
> Thierry

Another way is to use "git pull --rebase". It basically does 
"git fetch" + "git rebase", rather than "git fetch" + "git merge" 
that the normal "git pull" does.

A good way to make sure what you are pushing will not result in
a merge is to use gitk (or giggle) before the push. If the graph
showing the commits is a straight line all is good, otherwise 
you need to rebase.

//Peter



More information about the uClibc mailing list