Git commit gives error: empty commit set passed

When trying to return to the previous commit, I tried:

git revert --no-commit 0766c053..HEAD

However, this gave an error:

empty commit set passed

Question: What does the error, and what went wrong with the team revert?

+4
source share
2 answers

It seems to me that you used the annotation incorrectly double dotto indicate the range of fixation.

Thus, your range does not return any commits, which means that revertit cannot do anything, since you effectively said "do not return any commits."

The gitpro book explains the double dotannotation (link to the chapter) quite solidly:

. Git , , arent . , , , 6-1.

Figure 6-1.  Example history for range selection.

, , . Git master..experiment - , , arent . " , :

$ git log master..experiment
D
C

, , - master, arent experiment - . experiment..master , master experiment:

$ git log experiment..master
F
E

+3

..HEAD. , (git v2.7.4) .

git revert --no-commit 0766c053

+1

Source: https://habr.com/ru/post/1548300/


All Articles