# git pull on a branch semantics

3 messages from 2006-01-22 to 2006-01-24. Participants: Luben Tuikov, Junio C Hamano.
Thread: https://gitlist.dev/t/3129

## Luben Tuikov, 2006-01-22 20:58

Subject: git pull on a branch semantics
Message-ID: <20060122205852.255.qmail@web31812.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20060122205852.255.qmail%40web31812.mail.mud.yahoo.com

```
Hi,

pwd is a git repo; current branch is A; there's a few
branches in this git repo.
In .git/remotes/ I've a file name "projectC", which looks like:

URL:<url>
Pull:projectC:projectC
Push:projectC:projectC

That is both here and remotely I've projectC being a branch
here and remotely.

I'd like to pull changes to projectC only, from the remote projectC to the local projectC, but my
current branch is A.

I blissfully do:

git pull projectC

git correctly tells me that the heads are the same in
branchC here and remote, but it then goes ahead to merge
projectC in the current branch A (project A) since they
have a common ancestor.

But because of the "Pull" line in .git/remotes/projectC
what the intention was is to pull from projectC remotely
and merge any new changes in projectC locally, and only
in projectC (irrespective of what the current branch
is (in the pwd)).

Is this behavior a bug or is this a "feature"?

Thanks,
   Luben

```

## Junio C Hamano, 2006-01-22 21:02

Subject: Re: git pull on a branch semantics
Message-ID: <7v7j8sc6wy.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v7j8sc6wy.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060122205852.255.qmail@web31812.mail.mud.yahoo.com>

```
Luben Tuikov <ltuikov@yahoo.com> writes:

> URL:<url>
> Pull:projectC:projectC
> Push:projectC:projectC
>
> That is both here and remotely I've projectC being a branch
> here and remotely.
>
> I'd like to pull changes to projectC only, from the remote projectC to the local projectC, but my
> current branch is A.
>
> I blissfully do:
>
> git pull projectC

You wanted to "git fetch", not "git pull" which is "fetch
followed by merge into the current branch".

```

## Luben Tuikov, 2006-01-24 15:37

Subject: Re: git pull on a branch semantics
Message-ID: <20060124153703.53338.qmail@web31804.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20060124153703.53338.qmail%40web31804.mail.mud.yahoo.com
In-Reply-To: <7v7j8sc6wy.fsf@assigned-by-dhcp.cox.net>

```
--- Junio C Hamano <junkio@cox.net> wrote:
> You wanted to "git fetch", not "git pull" which is "fetch
> followed by merge into the current branch".

Ah, ok, thanks Junio.

   Luben

```
