threads / discuss / 13707

git-gui clone differs from command line

Subject: git-gui clone differs from command line

## tl;dr

4 messages between May 28, 2008 and May 29, 2008.

replies: 3people: 3as markdown or json

Barry Roberts· May 28, 2008, 15:21 UTC · lore

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· May 28, 2008, 23:23 UTC · re: Barry Roberts · lore

Re: git-gui clone differs from command line

Barry Roberts <blr@robertsr.us> wrote:
Show 5 quoted lines
> 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:
 
Show 10 quoted lines
> 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· May 29, 2008, 02:59 UTC · re: Shawn O. Pearce · lore

Re: git-gui clone differs from command line

On Wed, 2008-05-28 at 19:23 -0400, Shawn O. Pearce wrote:
Show 36 quoted lines
> 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· May 29, 2008, 13:40 UTC · re: Barry Roberts · lore

Re: git-gui clone differs from command line

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

← back to recent threads