code_fodder
code_fodder

Reputation: 16401

Can someone explain 'git revert ...'

I read the post: how-do-i-revert-all-local-changes-in-git-managed-project-to-previous-state, which is a very good post / answer, so plus 1's all around.

I understand all the commands that are mentioned, except this one:

git revert ...

What do the dots mean? - I am sure the answers are on the web, but the search engines seem to ignore punctuation, so I get hundreds of pages of basic git revert with no other mentions of "...".

Upvotes: 3

Views: 460

Answers (2)

robertklep
robertklep

Reputation: 203534

The three dots are meant as a placeholder (meaning that you should replace the three dots with an actual argument). They are used as an ellipsis (which is confusing, as ... also has special meaning as a range operator for Git).

The manual page may be helpful:

$ man git-revert

NAME
       git-revert - Revert some existing commits

SYNOPSIS
       git revert [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<keyid>]] <commit>...

So git revert expects a <commit> argument (without the angle brackets). The three dots here indicate that you can also pass more than one <commit> argument.

Upvotes: 2

Nir Duan
Nir Duan

Reputation: 6392

Triple Dot is a Range Selection Syntax.

Specifies all the commits that are reachable by either of two references but not by both of them

You can find good SO answer here and officalk doc here

Upvotes: 1

Related Questions