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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:27:08+00:00 2026-06-07T20:27:08+00:00

Using Git, I was working on a feature branch. I pushed the branch to

  • 0

Using Git, I was working on a feature branch. I pushed the branch to github so someone could look at it. Then, it had been a while, so I rebased it. How do I push my rebased branch over the old one? What pitfalls must I avoid? I think it’s just git push --force (or --mirror?), but I’m never sure.

Some relevant links:

  • https://stackoverflow.com/a/255080/237091
  • https://stackoverflow.com/a/930160/237091
  • 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-06-07T20:27:10+00:00Added an answer on June 7, 2026 at 8:27 pm

    You want to use git push --force but please remember that you are rewriting public history.

    Rewriting public history is a very bad idea. Anyone else who may have pulled the old history will have to git pull --rebase and even worse things if they have tagged or branched from the rewritten history, so you must publish your humiliation so they know what to do.

    The server may not allow this (but will on github). See receive.denyNonFastForwards (git-config)

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

Sidebar

Related Questions

I'm using git-svn to work with an SVN repository. My working copies have been
Our development process involves using git feature branches and code reviews done through github.
I've been using Git for a while now and love the features and flexibility
Coming from Sourcesafe, I have primarely been using git as a major undo feature.
I've been using Git for a while, and I'd like to convert my usual
I'm using git. I'm working on branch, let say it is branch A .
I am using TortoiseGit and am working with an svn repository using git-svn. Sometimes
I am currently working with a subversion repository but I am using git to
I am using gitolite as git server. It was working fine earlier . but
I just started using git with github. I followed their instructions and ran into

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.