G
G
Georgy Pelageykin2015-03-07 19:04:15
git
Georgy Pelageykin, 2015-03-07 19:04:15

Confusion in git with commit history, how to undo two commits and merge?

Hello. Accidentally typed in the commit message, did not notice, sent to a remote repository (bitbucket). Due to inexperience, I tried to fix it with the amend command. Send to remote failed. Made a pull, after which it was possible to send. But it turned out the merging of branches (master and master?). After that I tried to do all sorts of resets and reverts. As a result, one commit has grown into three + one more in the local (not sent yet):
ff8a158ffece4964a9dbba1235bf613e.png
And in the local repository there is also one revert commit, but at least this can be solved with a simple "delete and re-upload everything". How to remove all this garbage from a remote repository? Don't leave it like that.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Victor, 2015-03-07
@ArXen42

git reset + git push --force
Provided that no one else downloaded this garbage from the remote repository and did not push something there after you.

V
Vovaka, 2017-11-13
@Vovaka

If several people work on your project, you need to revert the failed merge, fix the error in the feature branch and, after performing the revert / revert, make another, corrected merge to the master.
This is described in more detail here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question