Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


git clone 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!

share|improve this question
up vote 2 down vote accepted

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

[url "git@"]
    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.

share|improve this answer
Great answer, thanks :) – 0x6d48 May 4 '12 at 9:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.