1

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)

2 Answers 2

4

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

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.

You must log in to answer this question.

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