git reset --merge and reset --keep

2

Trying to dig deeper into git I found a couple of options in git however after reading the documentation and researching on my own I can not fully understand how they work and what exactly the following commands do

 git reset --merge <commit>
 git reset --keep <commit>

I've done some basic tests to see if I found out how they work

for this create a new repository with 3 commits

  • The first one added a file (file1) with a single line.
  • The second one added a new line to the file
  • The third one added a new line to the file and created a new file (file2)

then I do the git reset --merge on the first commit and it resets the working tree instead of updating it (as it says in the documentation) that is to say as if it were doing a reset --hard

the reset --keep does the same.

Could someone explain to me what they are and what is the objective or practical case for which these reset modes were created?

    
asked by Polo 29.11.2017 в 19:47
source

0 answers