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

remote tracking branches

From
JDJohn Dlugosz <jdlugosz@tradestation.com>
Date
Feb 25, 2009, 17:41 UTC
Message-ID
<450196A1AAAE4B42A00A8B27A59278E709E0485C@EXCHANGE.trad.tradestation.com>

The repository on my machine was apparently originally a simple file copy from another development machine, or set up manually. That is, was not done by using the "git clone" command. I have a [remote "pub"] in the config file with only a url in it, so I can use "pub" when I push and pull.

The command "git branch -r" shows nothing.
So, there are no remote tracking branches.  So what?  At first, I think
that this is nothing more than the defaults to use when pulling, to get
everything.  But, the example at the very end of Chapter 1 of the user
manual shows:
	fetch = +refs/heads/*:refs/remotes/linux-nfs/*
I don't have a refs/remotes directory now.  So what does
	git pull pub xx
do?  The _result_ is just fine, as expected.  But if pull calls fetch,
it needs to fetch it to some temporary place first and then merge that,
right?

If I add a suitable line to my config file (changing linux-nfs in the example to pub to match the remote name), what does that buy me? But first, is that all I need to do to enable this feature?

I'm guessing that it means I will be able to examine, e.g. using gitk, what is in pub, to see if there are changes I need and keep apprised of other's work.

--John
Next: Jay Soffian
Message 1 of 2 in “remote tracking branches”
  1. John DlugoszFeb 25, 2009
  2. Jay SoffianFeb 25, 2009

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.