From: Junio C Hamano <gitster@pobox.com>
To: Thomas Glanzmann <thomas@glanzmann.de>
Cc: GIT <git@vger.kernel.org>
Subject: Re: merge into branch currently not active / checked out
Date: Sun, 17 Jun 2007 02:27:50 -0700 [thread overview]
Message-ID: <7vmyyzylpl.fsf@assigned-by-dhcp.pobox.com> (raw)
In-Reply-To: <20070617072225.GF23473@cip.informatik.uni-erlangen.de> (Thomas Glanzmann's message of "Sun, 17 Jun 2007 09:22:25 +0200")
Thomas Glanzmann <thomas@glanzmann.de> writes:
> Hello,
> is it possible to merge into a branch currently not active/checked out?
> I have the following scenario:
>
> - One branch per feature (cstatus, headers, mutt-collapse-flags, small-fixes)
> - One upstream branch (master)
> - One branch that has every feature branch (tg)
>
> (faui00u) [~/work/mutt/mutt] git branch
> cstatus
> headers
> master
> mutt-collapse-flags
> small-fixes
> * tg
>
> I want to merge master in every of the feature branches. Is that possible or
> just bullshit because I don't have a working tree to handle conflicts?
Exactly. Merge would want to have working tree, so merging into
the current branch is not just the default but the only mode of
operation.
In general, I would recommend against merging 'master' to topic
branches, if you can avoid it.
There are two reasons you would ever want to merge 'master' to
them.
(1) You notice that 'master' has new stuff. It does not
necessarily conflict with the changes you made to your
topic branches, and it often doesn't, if the project is
well modularized. Still, you want to make sure that your
topic branches are compatible with it. IOW to see if the
changes in the master did not break your topic.
(2) You notice that 'master' actually have new change that
actively interact with what you set out to do in some of
your toipcs.
If you plan to eventually ask somebody who integrates the
'master' to pull from you, and keep the resulting development
history clean, (1) is _NOT_ a good reason to merge 'master' into
your topics. Because after your topic finally is finished, when
'master' pulls it, it will see many "senseless" merges from
itself.
Such "an integration testing" is better done, instead, by
forking a 'test' (perhaps throw-away) branch from 'master', and
merging all your topics into it.
On the other hand, (2) is a valid reason to resolve conflict
(both textual and semantic) early before you eventually present
your work for inclusion to 'master'.
Also, if you do not publish your work-in-progress topics, you
might want to consider rebasing on top of 'master', instead of
'merging'. Rebase can take the topic branch name and switch
your current branch for you when you give it, like so:
$ git rebase master topic1
$ git rebase master topic2
...
next prev parent reply other threads:[~2007-06-17 9:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-17 7:22 merge into branch currently not active / checked out Thomas Glanzmann
2007-06-17 9:27 ` Junio C Hamano [this message]
2007-06-17 10:16 ` Thomas Glanzmann
2007-06-20 7:54 ` Karl Hasselström
2007-06-17 9:45 ` Alex Riesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vmyyzylpl.fsf@assigned-by-dhcp.pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=thomas@glanzmann.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox