0

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?

1
  • For what shell and/or operating system? Feb 29, 2012 at 19:40

1 Answer 1

1

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.

2
  • 1
    Something like this function push { git push origin $1:$1; }?
    – JAM
    Feb 29, 2012 at 19:48
  • do you want to use $2 (for B?)
    – Mallik
    Feb 29, 2012 at 19:52

You must log in to answer this question.

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