Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7656059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:40:20+00:00 2026-05-31T12:40:20+00:00

I did an evil thing in github: used rebase, then push –force. This was

  • 0

I did an evil thing in github: used rebase, then push –force. This was because I wanted to change the name associated with my commits, and have it reflected in the repository.

As is warned elsewhere, this can have consequences for other upstream or downstream repos.

The consequence I am seeing is duplicate commit messages in the upstream repo after they did a merge.

We have the following structure:

Main (fairly inactive)
– Evil (very active)
– Others (very inactive)

My question is: how do I get Main into a good state if is already has a few commits. My suggested plan of action is:

  • git clone Main
  • git reset [pre-merge-commit]
  • git stash
  • git push –force
  • git stash pop
  • git push

I am a little reluctant to do this without being sure it will (a) fix the problem and (b) not create more disasters. The ‘Evil’ respository has been very active since it performed its own reset/push, and I assume that they will need to do something like:

  • git pull
  • git reset [largest-commit-that-still-exists-on-Main]
  • git stash
  • git push –force (to revert ‘Evil’ to a state that exists in Main)
  • (pull stuff from Main and merge normally)
  • git stash pop
  • git push (to apply local changes)

Is this right?

Finally, the ‘Evil’ repository has numerous commits done after it did the reset/push. Is there any way to ensure all the commit messages are preserved when it resyncs with Main?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:40:21+00:00Added an answer on May 31, 2026 at 12:40 pm

    Judging from what you’ve described, I’d say probably your best bet would be the second possibility mentioned in your comment – namely, continue to modify “Evil” until it is as accurate as possible, then have “Main” reset to where Evil is. Any downstream users can rebase (using the --onto flag) onto the “new world order” from “Evil”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just squashed some commits with git rebase and did a git push --force
Did anyone who used jQuery Easy Confirmation plugin run into this issue - the
Did you used Dynamic websites before? you see its a good way for making
did someone else encounter this problem? I use the methods PopUpManager.createPopUp() and PopUpManager.centerPopUp() to
Did a dumpdata of my project, then in my new test I added it
Did anyone create a Document Management System using SQL SERVER's Filestream? By this I
Did a quick search but could not find anything about this. I guess all
Did any of guys run into this error where the search crawler is ignoring
Did somebody come up with this pattern so it is a famous and well-known
did a search for this and didn't find an answer, so here goes... I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.