threads / discuss / 9304

Merging into a current branch

Subject: Merging into a current branch

## tl;dr

2 messages between Jul 30, 2007 and Jul 30, 2007.

replies: 1people: 2as markdown or json

Shawn O. Pearce· Jul 30, 2007, 05:48 UTC · re: Geoff Russell · lore

Re: Merging into a current branch

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.

← back to recent threads