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

Re: Do most people feel tracking branches useful?

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Oct 29, 2008, 10:03 UTC
Message-ID
<20081029100313.GP3612@atjola.homenet>
In-Reply-To
<49082514.9050405@gmail.com>
On 2008.10.29 16:55:48 +0800, Liu Yubao wrote:
Show 10 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)

Actually, origin/master is the "[remote] tracking branch". master is just a branch that has config settings for "git pull" defaults. ;-)

"Remote branches" are the actual branches on a remote repository.
Show 10 quoted lines
> 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:
> 
> 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).
git pull --rebase
> I don't want to bother with the tracking branch "master", it's identical
> with "origin/master".  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?

Tracking branches (origin/* etc.) are very useful :-) And branches that have "git pull" defaults (what you called "tracking branch") are also useful.

In your case, you probably want: git checkout -b my-stuff origin/master git config branch.my-stuff.rebase true

and then you can do: git pull

Instead of: git fetch origin git rebase origin/master

You can also setup branch.autosetuprebase, to automatically get the rebase setup, so you can skip the call to "git config" above.

And you can just delete the "master" branch if you don't use it. There's nothing that forces you to keep any branches around that you don't use. But that doesn't affect the usefulness of tracking branches or branches that have "git pull" defaults :-)

> BTW: I feel the terminalogy "remote branch" is confused, because I must
> synchronize it with `git fetch`. I feel it's better to call it "tracking
> branch" // seems will lead to bigger confusion to experienced git users:-(
See above, that's already the case ;-)
Björn
Previous: Andreas EricssonNext: Liu Yubao
Message 8 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.