# git-gui clone differs from command line

4 messages from 2008-05-28 to 2008-05-29. Participants: Barry Roberts, Shawn O. Pearce, Johannes Schindelin.
Thread: https://gitlist.dev/t/13707

## Barry Roberts, 2008-05-28 15:21

Subject: git-gui clone differs from command line
Message-ID: <483D7884.2050407@robertsr.us>
URL: https://gitlist.dev/e/483D7884.2050407%40robertsr.us

```
After much mis-directed research, I finally figured out that cloning a 
repo (ssh://) with git-gui doesn't work exactly like 'git clone' from 
the command line.  The main difference is that 'git pull' doesn't work 
on master.  I get the error below.  Is that intentional, or are we doing 
something wrong?


 From ssh://blr@cvs2/var/git/iv
 = [up to date]      master     -> origin/master
 = [up to date]      mbn/xtol   -> origin/mbn/xtol
 = [up to date]      sprint2    -> origin/sprint2
 = [up to date]      sprint3    -> origin/sprint3
 = [up to date]      sprint4    -> origin/sprint4
 = [up to date]      xtol       -> origin/xtol
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either.  Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.

If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:

    branch.master.remote = <nickname>
    branch.master.merge = <remote-ref>
    remote.<nickname>.url = <url>
    remote.<nickname>.fetch = <refspec>

See git-config(1) for details.

```

## Shawn O. Pearce, 2008-05-28 23:23

Subject: Re: git-gui clone differs from command line
Message-ID: <20080528232324.GM30245@spearce.org>
URL: https://gitlist.dev/e/20080528232324.GM30245%40spearce.org
In-Reply-To: <483D7884.2050407@robertsr.us>

```
Barry Roberts <blr@robertsr.us> wrote:
> After much mis-directed research, I finally figured out that cloning a 
> repo (ssh://) with git-gui doesn't work exactly like 'git clone' from 
> the command line.  The main difference is that 'git pull' doesn't work 
> on master.  I get the error below.  Is that intentional, or are we doing 
> something wrong?

Bug in git-gui.

git-gui's clone feature isn't implemented in terms of git-clone.
Its implemented in terms of more primitive actions:

	git init
	git remote add origin
	git fetch
	git fetch --tags
	git update-ref refs/heads/master origin/master
	git checkout

however it forgets to setup the branch configuration:
 
> If you often merge with the same branch, you may want to
> configure the following variables in your configuration
> file:
> 
>    branch.master.remote = <nickname>
>    branch.master.merge = <remote-ref>
>    remote.<nickname>.url = <url>
>    remote.<nickname>.fetch = <refspec>
> 
> See git-config(1) for details.

Yea.  That author of git-gui should really check git-config(1)
for detais.  *ducks and hides*

I'll try to fix it tonight or tomorrow.

-- 
Shawn.

```

## Barry Roberts, 2008-05-29 02:59

Subject: Re: git-gui clone differs from command line
Message-ID: <1212029963.8891.2.camel@gdub.robertsr.us>
URL: https://gitlist.dev/e/1212029963.8891.2.camel%40gdub.robertsr.us
In-Reply-To: <20080528232324.GM30245@spearce.org>

```

On Wed, 2008-05-28 at 19:23 -0400, Shawn O. Pearce wrote:
> Barry Roberts <blr@robertsr.us> wrote:
> > After much mis-directed research, I finally figured out that cloning a 
> > repo (ssh://) with git-gui doesn't work exactly like 'git clone' from 
> > the command line.  The main difference is that 'git pull' doesn't work 
> > on master.  I get the error below.  Is that intentional, or are we doing 
> > something wrong?
> 
> Bug in git-gui.
> 
> git-gui's clone feature isn't implemented in terms of git-clone.
> Its implemented in terms of more primitive actions:
> 
> 	git init
> 	git remote add origin
> 	git fetch
> 	git fetch --tags
> 	git update-ref refs/heads/master origin/master
> 	git checkout
> 
> however it forgets to setup the branch configuration:
>  
> > If you often merge with the same branch, you may want to
> > configure the following variables in your configuration
> > file:
> > 
> >    branch.master.remote = <nickname>
> >    branch.master.merge = <remote-ref>
> >    remote.<nickname>.url = <url>
> >    remote.<nickname>.fetch = <refspec>
> > 
> > See git-config(1) for details.
> 
> Yea.  That author of git-gui should really check git-config(1)
> for detais.  *ducks and hides*
> 
> I'll try to fix it tonight or tomorrow.

No worries.  I just e-mailed out a [branch "master"] section
from .git/config from a cmd-line clone'd repo and all the Windows users
are happy.  Oddly, our Linux users never saw this ;-)

Thanks,
Barry

```

## Johannes Schindelin, 2008-05-29 13:40

Subject: Re: git-gui clone differs from command line
Message-ID: <alpine.DEB.1.00.0805291440160.13507@racer.site.net>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0805291440160.13507%40racer.site.net
In-Reply-To: <1212029963.8891.2.camel@gdub.robertsr.us>

```
Hi,

On Wed, 28 May 2008, Barry Roberts wrote:

> No worries.  I just e-mailed out a [branch "master"] section from 
> .git/config from a cmd-line clone'd repo and all the Windows users are 
> happy.  Oddly, our Linux users never saw this ;-)

Of course, it would be even nicer if you patched git-gui yourself.  It's 
not like Shawn is paid full-time to work on git-gui.

Ciao,
Dscho

```
