1

I'm using the zsh shell on ArchLinux and I want to know if there's an easy way to make "advanced" aliases.

Normal aliases work just fine. However I can't find a way to create an alias for a substitution like:

git clone git@home:some-repo.git

to

git clone [email protected]:repositories/some-repo.git

Is there any simple way at all to do this directly in zsh with alias (or something similar)? Of course it should be generic so I don't need and alias for every git action on every repository.

Thanks in advande!

1 Answer 1

3

In this particular case, you can do it through git rather than through zsh. Add the following to your ~/.gitconfig:

[url "[email protected]:repositories/"]
    insteadOf = "home:"

Now git clone home:some-repo.git (and other git commands) will use the correct repo.

In the more general case, if you want to do a command substitution that's more advanced than what an alias allows, look at shell functions.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .