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 do this command a lot

git merge --no-ff --no-commit SomeBranch

I tried to make an alias

git config alias.nff "merge --no-ff --no-commit $1"

and use it

git nff SomeBranch

But I got and error and saw this in my config file

[alias]
    nff = "merge --no-ff --no-commit "

So I changed it to

    nff = "merge --no-ff --no-commit $1"

However I still get an error when I run the command

$ git nff SomeBranch
fatal: $1 - not something we can merge

Why is it using $1 instead of my argument? And how might I set it via command like (i had to add $1 by hand in the config file)

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You don't need $1

git config alias.nff "merge --no-ff --no-commit"

Will do the trick

git nff SomeBranch

expands to

git merge --no-ff --no-commit SomeBranch
share|improve this answer
    
+1 when i get enough rep –  BruteCode Jan 31 '13 at 13:49

Fist idea that come in my head it's write bat files for all commands that u use, put them in separate folder and path to this folder to you PATH variable.

i'm not sure that this is a good way, but i only say my idea about that.

share|improve this answer

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.