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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:16:52+00:00 2026-05-25T16:16:52+00:00

Background: I have a feature branch A that is one commit ahead of my

  • 0

Background:

I have a feature branch A that is one commit ahead of my development branch:

3   (develop, origin/develop)
| 2 (A, origin/A) some feature branch commit
|/
1   some commit

Then I rebase A on develop (git checkout A, git rebase develop), so I get:

2'  (A) some feature branch commit
|
3   (develop, origin/develop)
| 2 (origin/A) some feature branch commit
|/
1   some commit

Now I can no longer push A to origin as Git will reject a non-fast forward commit. It tells me to first pull the remote changes.

When I do so and then push, I end up with the following history:

4   (A, origin/A) merged origin/A into A
|\
2'| some feature branch commit
| |
3 | (develop, origin/develop)
| 2 (origin/A) some feature branch commit
|/
1   some commit

I end up with a history containing the 2 commit twice — technically different commits although they do the same thing.

Questions

  1. How can I prevent this from happening? How can I mirror my local rebase operation on the remote repo?
  2. How can I remedy this situation? What would be the most elegant way to clean up the history and show only one commit?
  • 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-25T16:16:52+00:00Added an answer on May 25, 2026 at 4:16 pm
    1. A rebase is rewriting history – to avoid trouble don’t rebase things that are pushed.

    2. You can push --force while A is checked out. origin/A history will be overwritten with your version of A. Note that this will require manual intervention from other developers in their repos afterwards.

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

Sidebar

Related Questions

I have a site design that uses background images and textures as a feature
Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e.
Background: we have an application that generates reports from HTML (that may or may
I have a tab widget where one of the tabs is a chat-type feature.
I have a feature on my site where a user can upload a background
Background: I have a project that is not at all large scale (2 ASP.NET
I have around 30 scenarios that all bar one require this step to be
Background: We have a ClickOnce-deployed WPF app, that talks to WCF Services, which in
Background: I have a winForm app that registers a user in the database based
I have a login page that has 2 tags that have a background image

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.