Please set your git instance to rebase by default

Eric S. Raymond esr at snark.thyrsus.com
Mon Dec 7 09:37:49 UTC 2015


If you look in your .git/config file you will find a section that
reads like this:

[branch "master"]
	remote = origin
	merge = refs/heads/master

Please modify it to read like this:

[branch "master"]
	remote = origin
	merge = refs/heads/master
	rebase = true

What this change does is tell git that whenever you pull from the
repo, you want it to behave as though you had given the --rebase
option.  That is, it should replay any un-pushed local work of yours
onto master *after* merging commits pulled from the repository.

The reason to do this is that it avoids the formation of merge
bubbles.  This linearizes the history and makes running bisections
easier to do - a significant win, considering that we want to be able
to bisect all the way backl to the fork point in case of problems and
are planning to build a linear replay branch to achieve that.  By
making this change now you will make it significantly easier for me
to build that replay.

This policy has one minor drawback.  First, you may occasionally get
this message:

    Cannot pull with rebase: You have unstaged changes.
    Please commit or stash them.

It means what it says.  Stash you changes with "git stash" and unstash
then when the pull and merge is done.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

Freedom begins between the ears.	-- Edward Abbey


More information about the devel mailing list