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.muel...@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 <hekon...@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 > > >