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

[Question] Fetching a new branch from remote

From
CBCarl Baldwin <cnb@fc.hp.com>
Date
Nov 28, 2005, 16:33 UTC
Message-ID
<20051128163356.GA8300@hpsvcnb.fc.hp.com>
Greetings,

I have a short question about git fetch. Say there is a new branch, call it 'new-branch' in a remote repository. I am interested in this branch and want to fetch it to 'new-branch' in my local to track its progress.

I would expect this to do it:
% git fetch -f <url> new-branch
But, it doesn't.
Actually, I just noticed that this accomplishes the desired result...
% git fetch <url> new-branch:new-branch

I also just noticed that the man pages only says that '-f' works on tags. Should it work on branches? Either way, it wasn't clear to me how to fetch a new branch from a remote and store it under the same name locally. In my opinion, git fetch -f should do this if given a branchname from the remote.

Carl
-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Carl Baldwin                        Systems VLSI Laboratory
 Hewlett Packard Company
 MS 88                               work: 970 898-1523
 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com
 Fort Collins, CO 80525              home: Carl@ecBaldwin.net
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Next: Junio C Hamano
Message 1 of 4 in “[Question] Fetching a new branch from remote”
  1. Carl BaldwinNov 28, 2005
  2. Junio C HamanoDec 1, 2005
  3. Jon LoeligerDec 1, 2005
  4. Carl BaldwinDec 2, 2005

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.