# bug with 'cl' as alias for 'clone'

4 messages from 2010-05-26 to 2010-05-26. Participants: James Tucker, Ramkumar Ramachandra, Nguyen Thai Ngoc Duy.
Thread: https://gitlist.dev/t/23913

## James Tucker, 2010-05-26 12:48

Subject: bug with 'cl' as alias for 'clone'
Message-ID: <E4D176D9-E1D2-4C8F-8F18-11060E49ED80@gmail.com>
URL: https://gitlist.dev/e/E4D176D9-E1D2-4C8F-8F18-11060E49ED80%40gmail.com

```
I've been running the following aliases for a long time now:

alias g='git' # in bash

% cat ~/.gitconfig | grep clone
  cl = clone

This appears to still be calling the right UI command:

% g cl
You must specify a repository to clone.
...

But when I try to actually clone a repository:

% ls rdbi
ls: rdbi: No such file or directory
% g cl http://github.com/erikh/rdbi.git
fatal: cannot set work tree after initialization
* ls -la rdbi/
total 0
drwxr-xr-x    2 raggi  staff    68 26 May 09:46 .
drwxr-xr-x  251 raggi  staff  8534 26 May 09:46 ..

So then, I try it with 'clone' instead of 'cl', and it works (after removing the dead initialized repo in ./rdbi):

* rm -rf rdbi/
% g clone http://github.com/erikh/rdbi.git
Initialized empty Git repository in ...

I could look into this later on when I'm not at $work, but as I have no knowledge of the UI internals, it'd be great if someone in the know could track this down.

Thanks in advance,

James
```

## Ramkumar Ramachandra, 2010-05-26 13:07

Subject: Re: bug with 'cl' as alias for 'clone'
Message-ID: <AANLkTinSKgn5IgO3F-gqy-7RTs36Xe_9NB1dvRQrq4SK@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinSKgn5IgO3F-gqy-7RTs36Xe_9NB1dvRQrq4SK%40mail.gmail.com
In-Reply-To: <E4D176D9-E1D2-4C8F-8F18-11060E49ED80@gmail.com>

```
Hi,

On Wed, May 26, 2010 at 2:48 PM, James Tucker <jftucker@gmail.com> wrote:
> % g cl http://github.com/erikh/rdbi.git
> fatal: cannot set work tree after initialization

I'm not able to reproduce this with Git 1.7. Which version are you using?

-- Ram

```

## James Tucker, 2010-05-26 13:13

Subject: Re: bug with 'cl' as alias for 'clone'
Message-ID: <CD06D0C2-BE89-4ECE-A453-CF5FD69A4B55@gmail.com>
URL: https://gitlist.dev/e/CD06D0C2-BE89-4ECE-A453-CF5FD69A4B55%40gmail.com
In-Reply-To: <AANLkTinSKgn5IgO3F-gqy-7RTs36Xe_9NB1dvRQrq4SK@mail.gmail.com>

```

On 26 May 2010, at 10:07, Ramkumar Ramachandra wrote:

> Hi,
> 
> On Wed, May 26, 2010 at 2:48 PM, James Tucker <jftucker@gmail.com> wrote:
>> % g cl http://github.com/erikh/rdbi.git
>> fatal: cannot set work tree after initialization
> 
> I'm not able to reproduce this with Git 1.7. Which version are you using?

I was using 1.7.1.

Someone in the IRC channel 'doener' spotted it after some tracing and so on. I was cloning inside a working dir of another repo, and this was causing the problem.

Thanks to everyone for their help!

```

## Nguyen Thai Ngoc Duy, 2010-05-26 16:39

Subject: Re: bug with 'cl' as alias for 'clone'
Message-ID: <AANLkTikVStq4KCp94GplKl0TwANKYlzMmp3IZrwvP6fU@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikVStq4KCp94GplKl0TwANKYlzMmp3IZrwvP6fU%40mail.gmail.com
In-Reply-To: <E4D176D9-E1D2-4C8F-8F18-11060E49ED80@gmail.com>

```
On Wed, May 26, 2010 at 2:48 PM, James Tucker <jftucker@gmail.com> wrote:
> I've been running the following aliases for a long time now:
>
> alias g='git' # in bash
>
> % cat ~/.gitconfig | grep clone
>  cl = clone
>
> This appears to still be calling the right UI command:
>
> % g cl
> You must specify a repository to clone.
> ...
>
> But when I try to actually clone a repository:
>
> % ls rdbi
> ls: rdbi: No such file or directory
> % g cl http://github.com/erikh/rdbi.git
> fatal: cannot set work tree after initialization

There is something with alias and work tree setup that I should have
addressed it with my series. I suspect that is the cause of this.
Unfortunately I have been too lazy these days. I'll try to work on it
again maybe this weekend.
-- 
Duy

```
