git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: Dangers of working on a tracking branch
Date: Fri, 16 Feb 2007 03:00:04 +0100	[thread overview]
Message-ID: <er333i$787$1@sea.gmane.org> (raw)
In-Reply-To: 17876.53654.426022.454712@lisa.zopyra.com

Bill Lear wrote:

> On Thursday, February 15, 2007 at 15:21:38 (-0600) Bill Lear writes:
>>On Thursday, February 15, 2007 at 16:00:23 (-0500) Nicolas Pitre writes:
>>>On Thu, 15 Feb 2007, Bill Lear wrote:
>>>
>>>> We are about to switch to git 1.5 from git 1.4.4.1.  I cannot remember
>>>> if someone posted about this, but what is the danger of working on a
>>>> tracking branch --- there are abundant cautions about doing this, but
>>>> I can't recall and can't find the reason this is bad.
>>>
>>>A tracking branch is supposed to be a local mirror of what is available 
>>>remotely.  If you commit local changes to it then you break that model.
>>
>>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".

You cannot fetch or push to the remote branch if you made some commits
on the tracking branch ("broke the model") and remote branch has other
commits. You can force the issue, but then either remote (for push)
or local (for fetch) commits would be lost.

Sidenote: for some branches you have to skip fast-forward check, because
they have rewritten history (e.g. pu branch in git.git).
 
> 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.

But one of those branches can be temporary "branch" FETCH_HEAD (if you
use "git pull <URL>" syntax, and do not use tracking (remote) branches).

> BTW, again, why does git clone not have an option to just create all
> of the "working versions" (better name needed) of tracking branches?

Because usually you work with one branch with tracking (remote) + local
branch workflow; I think with multiple branches you usually use temporary
feature branches...

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

  parent reply	other threads:[~2007-02-16  2:00 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
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 [this message]
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='er333i$787$1@sea.gmane.org' \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /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).