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

Re: Merging into a current branch

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jul 30, 2007, 05:48 UTC
Message-ID
<20070730054837.GS20052@spearce.org>
In-Reply-To
<93c3eada0707292240qe92aa57s5c5152e078693a53@mail.gmail.com>
Geoff Russell <geoffrey.russell@gmail.com> wrote:
Show 5 quoted lines
> Is there any reason why
> 
> git fetch origin branchX:branchX
> 
> fails if I am on branchX?   All I want to do is fast forward it.
Yes.

A fetch will *only* update the branch. If the branch is your current branch it won't update the working directory. This safety check is to prevent the branch from updating, but the working directory staying unchanged, and the resulting git-status output looking like you just undid all of the recent work done on branchX of origin.

Try git-pull instead:
  git pull origin branchX
-- 
Shawn.
Previous: Geoff Russell
Message 2 of 2 in “Merging into a current branch”
  1. Geoff RussellJul 30, 2007
  2. Shawn O. PearceJul 30, 2007

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.