N
N
Nonpacie2021-02-09 02:53:06
git
Nonpacie, 2021-02-09 02:53:06

How to remove all unnecessary commits and locales on the server, as if they were not there?

A short story before, I work with GitLab in the rider, I made an unnecessary commit + push, I made a HARD reset through the rider, locally all the commits remained, as on the server, and the new commit is where everything is ok, which I really need, just wants to merge or rebase with what is on the server, then in general the porridge will not be necessary for me. What can I do to revert everything back to my first commit (Marked in the photo)?
6021cedb22b3d182089935.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Kuznetsov, 2021-02-18
@Nonpacie

On the screen we see that everything worked out locally. It remains to send it to the server, but you can only force it.
git push origin --force
Then the branch pointer origin/master will also return to "Initial Attempt".
The commits themselves are not actually deleted anywhere. You will simply stop seeing them, since there are no links to them.
Finally they will be deleted after "garbage collection".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question