-1

I would like to add new command on my Git Bash (just now i am under Windows OS). I tryed to look on Web different solutions but I did not find anything. The command that i like to add is:

commitall -> git add --all && git commit -m "$*"

There is a way to add this command on Windows Git Bash?

Thanks

Mifeet
  • 12,949
  • 5
  • 60
  • 108
youngz
  • 179
  • 2
  • 16
  • Possible duplicate of [git alias command is not working can any one describe me syntax of git alias command](http://stackoverflow.com/questions/34788557/git-alias-command-is-not-working-can-any-one-describe-me-syntax-of-git-alias-com) – CodeWizard May 01 '16 at 10:39
  • 2
    Possible duplicate of [How do I alias commands in git?](http://stackoverflow.com/questions/2553786/how-do-i-alias-commands-in-git) – randers May 01 '16 at 11:04

1 Answers1

0

Use Git aliases, like so:

git config --global alias.commitall '!git add --all && git commit -m'

There's no need to use $* because all the arguments you specify will simply be appended to the line above, i.e. if you run:

git comitall "a message"

…the following will be executed:

git add --all && git commit -m "a message"