You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2013/06/05 15:26:20 UTC

Good practice - When doing pull to get latest source code updates

Hi

A good practice is to pull with rebase like

git pull --rebase

Then we avoid those ugly merge commit in the commit log.
> Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/camel

There is a way to tell git to always to rebase when you do a git pull.
Though on top of my head I don't know how. But ppl can google and find
it out.


--
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Good practice - When doing pull to get latest source code updates

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I think we have all done 'em since its not default out of the box.
A bunch of mine was in hawtio as I got a new computer and reinstalled
my stuff from scratch, etc.

Keep on happy hacking.


On Wed, Jun 5, 2013 at 4:07 PM, Henryk Konsek <he...@gmail.com> wrote:
>> There is a way to tell git to always to rebase when you do a git pull.
>
> These are my ugly merge commits. Sorry for the mess. :)
>
> I configured [1] my git with global pull rebase, so I won't bother you
> with merge commits anymore.
>
> Cheers.
>
> [1] git config --global branch.autosetuprebase always
>
> --
> Henryk Konsek
> http://henryk-konsek.blogspot.com



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Good practice - When doing pull to get latest source code updates

Posted by Chris Geer <ch...@cxtsoftware.com>.
For what it's worth this is a little ruby script we use in our environment
to update from git.

    stash = /Saved working directory/.match(`git stash`)
    unless stash.nil?
      puts "Local working changes have been stashed"
    end

    `git fetch`
    `git rebase -p`
    unless stash.nil?
      `git stash pop -q --index`
      puts "Local working changes have been re-applied"
    end

The steps are:
 - Stash working changes since rebase requires a clean working directory -
also store if there was anything to stash
 - git fetch
 - git rebase -p, we use this combination instead of pull --rebase because
it handles rebasing if there have been local merges from feature branches
since we use "git flow"
 - If the first step did stash anything we unstash it automatically

Chris


On Thu, Jun 6, 2013 at 2:01 PM, Christian Müller <
christian.mueller@gmail.com> wrote:

> Thanks for sharing Henryk!
>
> Best,
>
> Christian Müller
> -----------------
>
> Software Integration Specialist
>
> Apache Camel committer: https://camel.apache.org/team
> V.P. Apache Camel: https://www.apache.org/foundation/
> Apache Member: https://www.apache.org/foundation/members.html
>
> https://www.linkedin.com/pub/christian-mueller/11/551/642
>
>
> On Wed, Jun 5, 2013 at 4:07 PM, Henryk Konsek <he...@gmail.com> wrote:
>
> > > There is a way to tell git to always to rebase when you do a git pull.
> >
> > These are my ugly merge commits. Sorry for the mess. :)
> >
> > I configured [1] my git with global pull rebase, so I won't bother you
> > with merge commits anymore.
> >
> > Cheers.
> >
> > [1] git config --global branch.autosetuprebase always
> >
> > --
> > Henryk Konsek
> > http://henryk-konsek.blogspot.com
> >
>

Re: Good practice - When doing pull to get latest source code updates

Posted by Christian Müller <ch...@gmail.com>.
Thanks for sharing Henryk!

Best,

Christian Müller
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Wed, Jun 5, 2013 at 4:07 PM, Henryk Konsek <he...@gmail.com> wrote:

> > There is a way to tell git to always to rebase when you do a git pull.
>
> These are my ugly merge commits. Sorry for the mess. :)
>
> I configured [1] my git with global pull rebase, so I won't bother you
> with merge commits anymore.
>
> Cheers.
>
> [1] git config --global branch.autosetuprebase always
>
> --
> Henryk Konsek
> http://henryk-konsek.blogspot.com
>

Re: Good practice - When doing pull to get latest source code updates

Posted by Henryk Konsek <he...@gmail.com>.
> There is a way to tell git to always to rebase when you do a git pull.

These are my ugly merge commits. Sorry for the mess. :)

I configured [1] my git with global pull rebase, so I won't bother you
with merge commits anymore.

Cheers.

[1] git config --global branch.autosetuprebase always

--
Henryk Konsek
http://henryk-konsek.blogspot.com