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 6604965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:13:37+00:00 2026-05-25T19:13:37+00:00

I’ve made a commit with an error (program isn’t compiled) and after made: git

  • 0

I’ve made a commit with an error (program isn’t compiled) and after made: git push (I).
My colleague done: git pull (She)
and got uncompiled state of repository. After that added some commits (about project documentation – for the compiling wasn’t critical) and done again: git push (She)
After that we’ve got following state of repository:

  1. Some her commit
  2. Some her commit
  3. My commit with error
  4. My another commit
    I wanted exactly to delete commit 3. And for that I’ve made
    git-rebase --onto <sha of commit 4> <sha commit 3> master
    git push --force

Now we have correct state of repository (without commit 3), but with all another changes.
But, if she do

git pull
git push

she will make merge with her local commit #3 and then pull it to repository. How can I make that someone (not only she) after git pull will correct state of repository – with all changes, but without commit #3?

Notes:
Probably she added (in another case – feature) local commits above last. And her local repository newer than server’s repository.

  • 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-25T19:13:37+00:00Added an answer on May 25, 2026 at 7:13 pm

    You have discovered the problem with changing public history: everyone who has seen the change must agree to change it the same way. In this simple case, they can likely get the new proper version by also doing the same rebase command that you did:

    git-rebase --onto <sha of commit 4> <sha commit 3> master
    

    This will update their local master to agree with the remote master branch again and they can continue as normal.

    There is no way to automatically cause this to happen. The easiest way for people who were simply tracking master, or had pushed all changes they made when you did this rebase, may be to execute git reset --hard origin/master but this will erase any local commits made on the current branch that weren’t in master when you did your rebase.

    An alternate way to achieve the same thing is with git revert. This will simply add a new commit which is the inverse of a different commitish. This doesn’t edit history, it simply adds to it in such a way as to undo it. This causes the problem commit to still show up in git log and related commands, but doesn’t cause issues for everyone else.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a bunch of posts stored in text files formatted in yaml/textile (from
I am trying to loop through a bunch of documents I have to put

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.