git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Do most people feel tracking branches useful?

From
Andreas Ericsson <ae@op5.se>
Date
Oct 29, 2008, 09:48 UTC
Message-ID
<49083166.7090804@op5.se>
In-Reply-To
<49082514.9050405@gmail.com>
Liu Yubao wrote:
Show 14 quoted lines
> 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.

Show 9 quoted lines
> 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
Previous: Miles BaderNext: Liu Yubao
Message 5 of 9 in “Do most people feel tracking branches useful?”
  1. Liu YubaoOct 29, 2008
  2. Miles BaderOct 29, 2008
  3. Liu YubaoOct 29, 2008
  4. Miles BaderOct 29, 2008
  5. Andreas EricssonOct 29, 2008
  6. Liu YubaoOct 29, 2008
  7. Andreas EricssonOct 29, 2008
  8. Björn SteinbrinkOct 29, 2008
  9. Liu YubaoOct 29, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.