git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Liu Yubao <yubao.liu@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Do most people feel tracking branches useful?
Date: Wed, 29 Oct 2008 10:48:22 +0100	[thread overview]
Message-ID: <49083166.7090804@op5.se> (raw)
In-Reply-To: <49082514.9050405@gmail.com>

Liu Yubao wrote:
> Hi,
> 
> I often feel tracking branches are useless to me, because there are remote
> branches and I work on my private branch in most time.
> 
>    repos
>      |
>      |-- my               (private branch, do my dirty work)
>      |-- master           (tracking branch)
>      |-- origin/master    (remote branch)
> 
> To avoid conflict when execute `git pull` and make the history linear, I work
> on branch "my" instead of "master". Here is my work flow:
> 

Use "git fetch" instead of "git pull" and you won't need the 'my' branch.
If you use "git pull --rebase" you won't need to bother at all.

> 1) use `git fetch` or `git remote update` to synchronize branch "origin/master"
> with branch "master" in remote repository;
> 2) create a new private branch to polish my commits and rebase it against
> "origin/master";
> 3) at last push this new branch to the remote repository or ask the upstream
> developer to fetch it(no `git pull` because we want history as linear as possible).
> 
> I don't want to bother with the tracking branch "master", it's identical
> with "origin/master".

Not unless you "git pull" when there's only fast-forward changes.

>  Because `git checkout -b xxx <remote_branch>`
> will create a tracking branch "xxx" by default, so my question is:
> do most people feel tracking branches useful?
> 

I use them all the time. They're immensely useful to me.

I can't understand why you're working so hard for a linear history, but perhaps
that's just an effect of only having leaf developers. I also can't understand
why you'd want to sync with upstream at all if you're just working on a single
feature/bugfix at the time, since you'd probably be better off by just completing
that single feature in your own time and doing "git pull --rebase && git push"
when you're done.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

  parent reply	other threads:[~2008-10-29  9:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29  8:55 Do most people feel tracking branches useful? Liu Yubao
2008-10-29  9:08 ` Miles Bader
2008-10-29  9:58   ` Liu Yubao
2008-10-29 13:29     ` Miles Bader
2008-10-29  9:48 ` Andreas Ericsson [this message]
2008-10-29 10:22   ` Liu Yubao
2008-10-29 11:53     ` Andreas Ericsson
2008-10-29 10:03 ` Björn Steinbrink
2008-10-29 10:38   ` Liu Yubao

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=49083166.7090804@op5.se \
    --to=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=yubao.liu@gmail.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).