From: Jeff King <peff@peff.net>
To: Bill Lear <rael@zopyra.com>
Cc: git@vger.kernel.org
Subject: Re: Dangers of working on a tracking branch
Date: Thu, 15 Feb 2007 16:43:52 -0500 [thread overview]
Message-ID: <20070215214352.GA2980@coredump.intra.peff.net> (raw)
In-Reply-To: <17876.53654.426022.454712@lisa.zopyra.com> <17876.52962.662946.582507@lisa.zopyra.com>
On Thu, Feb 15, 2007 at 03:21:38PM -0600, Bill Lear wrote:
> Ok, so I break the model, what is the harm in that? Can I no longer
> pull from or push to the remote branch? Do I corrupt something
> locally? Does something else break? I'm trying to formulate an
> explanation to our users why the 1.5 way is superior and I can't just
> say "if you do that you break the model".
The commits you make will not actually go onto that tracking branch;
they will be part of a "detached HEAD" (that is, your HEAD doesn't point
to _any_ branch). Once you check out a different branch, you will
potentially lose those commits (actually, they will still be available
through your reflog, but you will have to know to look for them there).
> BTW, my ignorant assumption is that for merging to take place, git
> requires two branches, so 'git pull' will fetch into the tracking
> branch and then merge onto your ... uh ... whatever the name of the
> working version of your tracking branch is.
That's more or less correct. You don't really have to have two branches;
doing a 'git pull /path/to/repo branch' will fetch the branch into the
temporary FETCH_HEAD name, and merge from that. But yes, the way a raw
'git pull' will work is to first fetch all tracking branches into
refs/remotes/origin/*, and then merge from whichever is defined by your
config.
And they're usually called "local branches" if you differentiating them
from remote tracking branches, or just "branches" otherwise.
> BTW, again, why does git clone not have an option to just create all
> of the "working versions" (better name needed) of tracking branches?
I don't recall anybody asking for it, yet. I think the idea is that
those branches would just be clutter. If you want to work on something,
it's easy enough to just start a local version of the branch:
git checkout -b topic origin/topic
-Peff
next prev parent reply other threads:[~2007-02-15 21:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-15 20:49 Dangers of working on a tracking branch Bill Lear
2007-02-15 21:00 ` Nicolas Pitre
2007-02-15 21:21 ` Bill Lear
2007-02-15 21:33 ` Bill Lear
2007-02-15 21:43 ` Jeff King [this message]
2007-02-15 21:53 ` Bill Lear
2007-02-15 21:58 ` Jeff King
2007-02-15 22:04 ` Bill Lear
2007-02-15 22:09 ` Shawn O. Pearce
2007-02-15 22:40 ` Bill Lear
2007-02-15 22:49 ` Shawn O. Pearce
2007-02-15 22:06 ` Jeff King
2007-02-15 22:30 ` Bill Lear
2007-02-16 2:00 ` Jakub Narebski
2007-02-16 15:13 ` Bill Lear
2007-02-16 15:21 ` Jeff King
2007-02-16 15:27 ` Bill Lear
2007-02-16 15:52 ` Jeff King
2007-02-16 16:10 ` Santi Béjar
2007-02-16 16:34 ` Nicolas Pitre
2007-02-16 16:40 ` Bill Lear
2007-02-15 22:14 ` Nicolas Pitre
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=20070215214352.GA2980@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=rael@zopyra.com \
/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;
as well as URLs for NNTP newsgroup(s).