What is the difference between -​- and – before a command option?

In git, we can modify commands with --some-thing or -s. From looking at the usage, it looks like the double-dash prefix is for option full-names while the single dash is for the abbreviation. Is that right or is there more to it?

  • ReviewBoard with git. “There don't seem to be any diffs!” but there are
  • Coda 2 still publishes files in .gitignore
  • git port - network requirement
  • proper workflow for concurrent versions
  • Rebase Conflicts Pulling One Repo Into Another
  • Keep file on remote, but cloning repo via Git will ignore that specific file
  • Git does not recognize new folder adds and its sub directories
  • Git Branches For Tutorials
  • How to display code in certain format but commit in another?
  • reverse a git fetch
  • What causes git-apply “corrupt patch?”
  • Delete single file from an old commit
  • 2 Solutions collect form web for “What is the difference between -​- and – before a command option?”

    Many of the fully named options (i.e., those prefixed with a --) have a shorthand prefixed with a single -. E.g., git log --grep=mureinik -i is equivalent to git log --grep=mureinik --regexp-ignore-case.

    If the option takes an argument, note that the shorthand switches are separated from their arguments with a whitespace, while the longer names use the = operator. E.g., git log -n 10 is equivalent to git log --max-count=10.

    That is indeed the difference.

    Many commands allow you to “bundle” options. For those commands,

    foo -bar
    

    is the same as

    foo -b -a -r
    

    To distinguish bundled options from options with longer names, -- is used to indicate that latter. That means that

    foo --bar
    

    only specifies one option.

    This is a well known convention adopted by all tools that want to avoid confusion.

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