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'd like to set up an alias push, which would translate into git push origin ARG1:ARG1.

For instance, from the command line, i'd like to push A B and get that translated to git push origin A:B

How should my alias export statement look for this to work?

share|improve this question
For what shell and/or operating system? – Oliver Salzburg Feb 29 '12 at 19:40
up vote 1 down vote accepted

You can use aliases to automatically pass default arguments to the original command.

So, in your case, you can alias git push origin with push if you need. But you can not achieve what you are trying to do. You should use bash functions instead.

share|improve this answer
Something like this function push { git push origin $1:$1; }? – Jam Feb 29 '12 at 19:48
do you want to use $2 (for B?) – Mallik Feb 29 '12 at 19:52
yeah, same deal :) Thanks – Jam Feb 29 '12 at 19:53

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.