What is the difference between –parameter and -parameter?

I used git for some time now, but mostly I preferred the integration with Intelij IDEA. Now, in order to extend my knowledge and understanding of the system I decided to use the command line more. What I observed is that there are two types of parameters:

--parameter and -parameter

for example:

  • How to read git push arguments in hook?
  • Remove Oldest File in Repository
  • Script/Bash: How to add if-statement and check fatal error?
  • Why does my string not split nicely into an array?
  • Why doesn't my git auto-update Expect script work?
  • Search for a branch name using wildcards
  •  git commit --amend -m "New commit message"
    

    I observed the same approach on some linux tools.

  • Git extension - What is Grey icon?
  • Commit a change to more than one branch in Git
  • Error when cloning git “shallow” repository
  • Node.js app in Heroku Works on Foreman but not When Deployed?
  • git branch restoration after merge
  • Rails / Carrierwave / GIT / nginx / Capistrano - can't create a directory in git releases folder
  • One Solution collect form web for “What is the difference between –parameter and -parameter?”

    — is used for multicharacter arguments, – is for singlecharacter arguments.

    For example, those are in many programs equivalent:

    program -h <-> program --help

    The reason is, if you use -, you can specify many arguments at once, for example:

    ls -lah gives a list of the directory content, all content, human-readible.

    It needs to know that you don’t mean the argument “–lah”, but “-l -a -h”

    Git Baby is a git and github fan, let's start git clone.