V
V
VicTHOR2020-02-03 11:47:36
git
VicTHOR, 2020-02-03 11:47:36

GIT REBASE after GIT MERGE - why delete does not work and how to use it in the future?

Let's say there are such commits

A - B - C - D  -  -  (M)
             \       /
               X - Y

After the merge in the history it turns out A - B - C - D - X - Y - M
1) How to do git merge so that the commits of the second branch are not taken into account? Those. only A - B - C - D - M, and the commits X - Yare gone.
2) How to delete X - Yin the current state?
I do git rebase -i master
The editor opens with the line noop
I remove noop and enter
d X
d Y
where X and Y are hashes of extra commits
Returns success, but the history does not change.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question