Re: Aliasing with parameters doesn't seem to work properly in git 1.7.0.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 3, 2010 at 07:52, Eugene Sajine <euguess@xxxxxxxxx> wrote:
> Hi,
>
> i'm trying to create an alias like this:
>
> cln = !sh -c 'git clone git://server/"$1"'
>
> the idea is to make a shortcut, so instead of command like this:
>
> $git clone git://server/folder/repo.git
>
> i can have something like this:
>
> $git cln folder/repo.git
>
> or even
> $git cln folder/repo
>
> if the alias is like this:
> cln = !sh -c 'git clone git://server/"$1".git'
>
> this doesn't work as it tries to initialize a repo called server.git
> and then fails because "remote hang up unexpecedly"
> is there something wrong in expansion of this alias or the alias
> itself is not valid?
>
> Any ideas?
>
> Thanks,
> Eugene


You need " -" at the end of your alias for the parameters to get through.

Try using:

cln = !sh -c 'git clone git://server/"$1"' -

or

cln = !sh -c 'git clone git://server/"$1".git' -
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]