From: Antriksh Pany Date: Tue, 12 Apr 2011 18:50:02 GMT Subject: Re: rebase on remote branch Message-ID: In-Reply-To: <6b4c9a4d-075c-4805-8fad-bacecb24e9de@w7g2000pre.googlegroups.com> > > or if we use cherry-pick model > > 0---0---0---0---*---*---* master >        \ >           0---0---*---*---* release > > but in this case , how do we do it in script? > I mean, how do we know we need to start cherry-pick from the 1st '*' > to the 3rd '*' in master > > more precisely , if A to E represents the commit SHA1 > > 0---0---0---0---A---B---C---D---E master >        \ >           0---0---A'---B'---C' release > > the 3 cherry-picks A' B' C' on release branch won't have the same SHA1 > for A B C in master > how can we know effectively we need to start cherry-pick from C to E > on master > You can start by using git log --cherry-pick .... which compares commits based on their patch contents, not just the SHA1. You can use a moving tag (say APPLIED) to keep track of till what point on master you have done the necessary cherry-picks, and then something like this may work for you: git log --cherry-pick release..master ^APPLIED Thanks Antriksh