Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git difference on parameter one dash and two dashes

Tags:

in git when I specify a parameter, ie

git log -n 5

what is the difference of using a parameter with one dash "-" as opposed to two dashes "--"

git log --author="Larvae"

like image 561
manuelBetancurt Avatar asked Jun 26 '13 12:06

manuelBetancurt


Video Answer


1 Answers

That's not really git specific. Many programs use the following convention:

  • single-letter parameter: one dash
  • multi-letter parameter: two dashes

This is handy, because it allows you to specify many single-letter parmeters at once with a single dash and all letters of the parameters you need: ls -al is equivalent to ls -a -l.

Often, one-letter parameters are the most used ones and can have a longer equivalent with two dashes: for example git add -v and git add --verbose mean the same.

like image 134
Benoit Avatar answered Nov 17 '22 04:11

Benoit