M
M
Matvey Nosurname2021-10-26 12:35:57
git
Matvey Nosurname, 2021-10-26 12:35:57

How to remove merge commit from a project?

I need to remove the merge commit that I made while pulling from remote. How can I do that?
6177cbcc4aea4287101698.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Saboteur, 2021-10-26
@matweykai

What for?
Do you want to push it? Then the history for all participants will change, and they all must agree with this and download a new version of the branch with commits. Can you sync this activity for all participants? (here, most likely, the simplest option is that you delete this commit yourself, for example, redoing the entire branch through rebase or rebase with squash, and the rest of the participants delete the entire repository and download it from scratch).
But why do this? A commit in a branch is simply an indicator that there was a merge from another branch in this place, and in order to avoid merge commits, in theory, it was necessary to choose the option during the merge

M
mkone112, 2021-10-26
@mkone112

In theory , well, or if no one else pulled off a turnip:
git revert -m 1 <hash>
git reset --hard <hash_до_нужного коммита>

D
Dmitry Gordinskiy, 2021-10-26
@DmitriyGordinskiy

You can do a rebase on the branch that pulled.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question