Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2021-10

Need help!

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

J. Gareth Moreton

Hi everyone,

I need a little bit of help.  I made a mistake and accidentally pushed on my local main branch.  I'm trying to revert it so I can resynchronise it with FPC's main branch, but it's not letting me. Do you know what I have to do?

Gareth aka. Kit

This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

J. Gareth Moreton
to J. Gareth Moreton

Just to clarify, I cannot delete the branch because it's the default branch, and it won't update with the mirror because it's diverged, and I can't revert the accidental commit on Gitlab because it just adds a new commit saying the last one is reverted, and is still marked as diverged.

Gareth aka. Kit

J. Gareth Moreton wrote 10 lines
Hi everyone, I need a little bit of help.  I made a mistake and accidentally pushed on my local main branch.  I'm trying to revert it so I can resynchronise it with FPC's main branch, but it's not letting me. Do you know what I have to do? Gareth aka. Kit
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

Jonas Maebe
to J. Gareth Moreton
J. Gareth Moreton wrote
Just to clarify, I cannot delete the branch because it's the default branch, and it won't update with the mirror because it's diverged, and I can't revert the accidental commit on Gitlab because it just adds a new commit saying the last one is reverted, and is still marked as diverged.

1) git reset --hard <hash of the top commit from fpc main>
2) verify with git log that you no longer have any unwanted commits
3) git push --force origin HEAD

Jonas

Reply by email

J. Gareth Moreton
to Jonas Maebe

Thanks Jonas,

I got main working again by changing the mirror to a force pull, since that branch is meant to be protected anyway.  I've also learnt about force pushes which is helping with the rebases too! I'm now trying to clean up my merge requests.

Gareth aka. Kit

Jonas Maebe wrote 17 lines
On 30/10/2021 22:26, J. Gareth Moreton via fpc-devel wrote: > Just to clarify, I cannot delete the branch because it's the default > branch, and it won't update with the mirror because it's diverged, > and I can't revert the accidental commit on Gitlab because it just > adds a new commit saying the last one is reverted, and is still > marked as diverged. 1) git reset --hard <hash of the top commit from fpc main> 2) verify with git log that you no longer have any unwanted commits 3) git push --force origin HEAD Jonas _______________________________________________ fpc-devel maillist  -  https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email