Merge or Cherry-Pick?
Kevin Ottens
ervin at kde.org
Wed Feb 2 07:02:31 GMT 2011
On Wednesday 2 February 2011 07:21:44 Dawit A wrote:
> On Wed, Feb 2, 2011 at 12:58 AM, John Tapsell <johnflux at gmail.com> wrote:
> >> But how would a similar work flow except there are multiple fixes
> >> present in the local repo ? How would you push only a single fix in
> >> such case ?
> >
> > git rebase -i origin #Bring up a list of your changes.
> >
> > <Reorder them in the editor so that the commit you want to push is at
> > the top of the list, save>
> >
> > <Fix any conflicts that might have arisen because you reordered the
> > commits>
> >
> > git pull --rebase #make sure we are up to date
> >
> > git log #copy the SHA of the commit you want to push up to
> >
> > git push origin SHA:head #paste the SHA that you just copied where I
> > wrote "SHA"
> >
> >
> > Does that make sense? There are other ways to do it, but this way
> > avoids most of the common problems.
>
> Yes. Great. IMHO that type of documentation is what is needed in techbase.
>
> One question though... why would i need to do git rebase -i origin if
> I always do git pull --rebase in the first place ? Wouldn't simply
> following the steps you mentioned after "git pull --rebase" suffice
> since I am going to be using the commit SHA to do the push ?
Because the order matters. git will push everything up to the commit with the
SHA1 passed as parameter. git rebase -i allows you to reorder your commits
first.
Regards.
--
Kévin Ottens, http://ervin.ipsquad.net
KDAB - proud patron of KDE, http://www.kdab.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110202/0f079adb/attachment.sig>
More information about the kde-core-devel
mailing list