Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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
1  
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

 
discard

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.