# git-pull can't be used without URL - Has worked before

4 messages from 2007-03-16 to 2007-03-16. Participants: Pelle Svensson, Paolo Bonzini, Matthias Lederhofer.
Thread: https://gitlist.dev/t/7270

## Pelle Svensson, 2007-03-16 10:24

Subject: git-pull can't be used without URL - Has worked before
Message-ID: <6bb9c1030703160324u17d49b85s754ac8358f633bde@mail.gmail.com>
URL: https://gitlist.dev/e/6bb9c1030703160324u17d49b85s754ac8358f633bde%40mail.gmail.com

```
Hi,

Did a setup of a new git-kernel, but this time git-pull can't be used without
full URL. What should I do.

Setup done this time
=================
[]$ git-clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[]$ git-checkout -b my-brach v2.6.21-rc3;
...
[]$ git-pull
Warning: No merge candidate found because value of config option
              "branch.my-project.merge" dose not match any remote
branch fetched.

Tried with success
==============
[]$ git-pull git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Then again
=========
[]$ git-pull
Warning: No merge candidate found because value of config option
              "branch.my-project.merge" dose not match any remote
branch fetched.

I don't have .../.git/remotes directory in this setup??

/Pelle

```

## Paolo Bonzini, 2007-03-16 11:51

Subject: Re: git-pull can't be used without URL - Has worked before
Message-ID: <45FA84D1.2020903@lu.unisi.ch>
URL: https://gitlist.dev/e/45FA84D1.2020903%40lu.unisi.ch
In-Reply-To: <6bb9c1030703160324u17d49b85s754ac8358f633bde@mail.gmail.com>

```

> I don't have .../.git/remotes directory in this setup??

For v1.5.0, git-clone sets up a remote repository so that
you can look at what's going on remotely like this:

  git log origin/next

To create your branch, you have to do something like

  git-checkout -b my-branch origin/next
  git-config add branch.my-branch.remote origin
  git-config add branch.my-branch.merge refs/heads/next

Note that the branch in the last command is the remote branch
name not the local name.


With the current git "master" branch, you are able to do
something like

  git-checkout --track -b my-branch origin/next

and git-pull (with no arguments) will automatically pull from
whatever branch you specified upon branch creation.  --track
also works with local branches, so you can have your topic
branches track the tip of your current development branch,
for example.

Paolo

```

## Paolo Bonzini, 2007-03-16 11:52

Subject: Re: git-pull can't be used without URL - Has worked before
Message-ID: <45FA84EF.3010103@lu.unisi.ch>
URL: https://gitlist.dev/e/45FA84EF.3010103%40lu.unisi.ch
In-Reply-To: <6bb9c1030703160324u17d49b85s754ac8358f633bde@mail.gmail.com>

```

> I don't have .../.git/remotes directory in this setup??

For v1.5.0, git-clone sets up a remote repository so that
you can look at what's going on remotely like this:

  git log origin/next

To create your branch, you have to do something like

  git-checkout -b my-branch origin/next
  git-config add branch.my-branch.remote origin
  git-config add branch.my-branch.merge refs/heads/next

Note that the branch in the last command is the remote branch
name not the local name.

<shameless-advertisement-of-my-patches>
With the current git "master" branch, you are able to do
something like

  git-checkout --track -b my-branch origin/next

and git-pull (with no arguments) will automatically pull from
whatever branch you specified upon branch creation.  --track
also works with local branches, so you can have your topic
branches track the tip of your current development branch,
for example.
</shameless-advertisement-of-my-patches>

Paolo

```

## Matthias Lederhofer, 2007-03-16 22:48

Subject: Re: git-pull can't be used without URL - Has worked before
Message-ID: <20070316224842.GA20775@moooo.ath.cx>
URL: https://gitlist.dev/e/20070316224842.GA20775%40moooo.ath.cx
In-Reply-To: <6bb9c1030703160324u17d49b85s754ac8358f633bde@mail.gmail.com>

```
Pelle Svensson <pelle2004@gmail.com> wrote:
> Did a setup of a new git-kernel, but this time git-pull can't be used 
> without
> full URL. What should I do.

git pull [<remote>] uses the first branch of 'remote' if there is no
special branch.name.{merge,remote} configuration.  But git clone will
setup remote.origin.fetch = +refs/heads/*:refs/remotes/origin/* which
uses wildcards and isn't used as 'first branch'.  You can add another
remote.origin.fetch line before this one in .git/config with

    fetch = +refs/heads/master:refs/remotes/origin/master

which worked for me.

```
