threads / discuss / 7270

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

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

## tl;dr

4 messages between Mar 16, 2007 and Mar 16, 2007.

replies: 3people: 3as markdown or json

Pelle Svensson· Mar 16, 2007, 10:24 UTC · lore
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· Mar 16, 2007, 11:51 UTC · re: Pelle Svensson · lore

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

> 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· Mar 16, 2007, 11:52 UTC · re: Pelle Svensson · lore

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

> 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· Mar 16, 2007, 22:48 UTC · re: Pelle Svensson · lore

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

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.

← back to recent threads