git rebase master

Adam Williamson awilliam at redhat.com
Mon May 27 21:11:10 UTC 2013


On Mon, 2013-05-27 at 23:04 +0300, Oron Peled wrote:
> On Monday 27 May 2013 18:17:19 Sérgio Basto wrote:
> 
> > I try
> 
> > fedpkg switch-branch f19
> 
> > git rebase master
> 
>  
> 
> Git rule #1 -- NEVER rebase a public branch (use "git merge")
> 
> [because rebasing rewrites history]

The ideal way to do it is to make your changes in 'master' and merge
them down to any branches which have not yet diverged from 'master' at
all: i.e. as long as your Rawhide and F19 builds are the same, you can
just make changes in 'master' and merge them to 'f19'. As soon as your
f19 build diverges from master at all, merging becomes inappropriate
(and probably impossible) and you should instead use 'cherry-pick'. It
helps to have at least a vague overview of how git is designed to be
used, and what is the actual _point_ of the commands you're using in the
intended git workflow.

Just because the *content* of two branches is identical does not mean
changes can be merged from one to the other with no issues. Merging will
only work without issues if the change history of each branch is the
same. In practice, you want to look at 'git log' for the two branches
and check the commit IDs. If the last few commit IDs differ - even if
the content of the commits is the same - you are not going to be able to
merge without issues.

At any point, if you're not sure what the hell is happening and you're
getting error messages, *don't* just whack it with a hammer until it
seems to be right, push that, and hope nobody notices; *do* yell for
help from someone who really understands git (note: not me) in
#fedora-devel or on here.
-- 
Adam Williamson
Fedora QA Community Monkey
IRC: adamw | Twitter: AdamW_Fedora | identi.ca: adamwfedora
http://www.happyassassin.net



More information about the devel mailing list