# Merging into a current branch

2 messages from 2007-07-30 to 2007-07-30. Participants: Geoff Russell, Shawn O. Pearce.
Thread: https://gitlist.dev/t/9304

## Geoff Russell, 2007-07-30 05:40

Subject: Merging into a current branch
Message-ID: <93c3eada0707292240qe92aa57s5c5152e078693a53@mail.gmail.com>
URL: https://gitlist.dev/e/93c3eada0707292240qe92aa57s5c5152e078693a53%40mail.gmail.com

```
Dear gits,

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.

Cheers,
Geoff.

```

## Shawn O. Pearce, 2007-07-30 05:48

Subject: Re: Merging into a current branch
Message-ID: <20070730054837.GS20052@spearce.org>
URL: https://gitlist.dev/e/20070730054837.GS20052%40spearce.org
In-Reply-To: <93c3eada0707292240qe92aa57s5c5152e078693a53@mail.gmail.com>

```
Geoff Russell <geoffrey.russell@gmail.com> wrote:
> 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.

```
