3

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 "...".

Community
  • 1
  • 1
code_fodder
  • 15,263
  • 17
  • 90
  • 167
  • I'm not sure that `git revert ...` is valid without the ellipis being part of a range of commits to revert. Are you asking about `git revert ...` literally? – Tim Biegeleisen Nov 09 '16 at 10:50
  • @TimBiegeleisen yes, really : ) ...well, take a look at the post on the link, unless I read it wrongly it is saying that you can use `git revert ...` to "revert a change that you can committed", which I take to mean revert just the last commit... – code_fodder Nov 09 '16 at 10:56
  • 2
    @KhorshedAlam ..ummm, no. Did you read the question? I am not asking about "git revert" in general, but specifically what "git revet ..." means - the question you refer to is totally different. – code_fodder Nov 09 '16 at 11:00
  • It doesn't mean anything, did you bother to read the answers? Either the ellipsis is just a placeholder, or it is part of a range of commits. – Tim Biegeleisen Nov 09 '16 at 11:01
  • @TimBiegeleisen yes I did read all of the answers thanks. And no, it was clearly not obvious to me that an ellipses meant a range, else I would not have asked the question. Now its clear from the answers below, thanks to all who answered. A very unfair -1, which means I'll take the good answers, and probably just delete the question later.... no issue for me, bad for the answer-ers of the question. – code_fodder Nov 09 '16 at 12:45
  • I think the close votes and downvotes were because it isn't a real question. But I removed my downvote. – Tim Biegeleisen Nov 09 '16 at 12:47
  • @TimBiegeleisen thanks. But what do you mean "not a real question". Its a vary real question, at least to me. I did not understand what I had read, and pointed to a link where I saw it. Now I do understand because my real question was answered very clearly : ) – code_fodder Nov 09 '16 at 12:49
  • Well I think if you type `git revert ...` from the Git bash it will error out. – Tim Biegeleisen Nov 09 '16 at 12:52
  • Yes, it gives `fatal: empty commit set passed`, but this does not mean the question is bad - I still want to know what is meant by `git revert ...`, and that was my question. I did not ask "What does the valid command `git revert ...` do?" ... anyway, not wanting to go on about it, but it does annoy me when the dup-police turn up and ruin perfectly good questions just because something sounds vaguely like something else. But thanks to you for seeing common-sense and debating the issue, it helps for future ref if nothing else : ) – code_fodder Nov 09 '16 at 12:57

2 Answers2

2

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.

robertklep
  • 198,204
  • 35
  • 394
  • 381
  • ah ok, so I am just taking it too literally! ... so its more like doing something like this: `git revert a867b4af 25eee4ca 0766c053`? taken from here: http://stackoverflow.com/questions/4114095/how-to-revert-git-repository-to-a-previous-commit/4114122#4114122 – code_fodder Nov 09 '16 at 11:01
1

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

Community
  • 1
  • 1
Nir Duan
  • 6,164
  • 4
  • 24
  • 38