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:

  • Run git bash script in Windows 7/64bit
  • How do I update my prompt to show current git branch on linux?
  • Don't want to use double quotes when using git commit -a -m
  • How to write a shell script that checks if git repository is up to date?
  • Git post-receive deployment stops working at random points
  • git ps1 bash not loading on Lion
  •  git commit --amend -m "New commit message"

    I observed the same approach on some linux tools.

  • What's the correct way to check if it's possible to perform a fast-forward merge with git merge-base?
  • Git push doesn't ignore files in .gitignore
  • Is it a bad idea to run multiple git repos in the same directory using the $GIT_DIR environment variable or --git-dir flag?
  • Can I prevent people from forking my code?
  • git submodules with only 1 directory?
  • “make clean” doesn't clean dependencies with Automake?
  • 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.