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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:39:18+00:00 2026-06-11T18:39:18+00:00

Something I’ve seen hammered in repeatedly is that one should not ever git push

  • 0

Something I’ve seen “hammered in” repeatedly is that one should not ever git push --force, though surely there are times when it is appropriate?

When is –force intended to be used?

My current example:

  1. Create branch and make some changes.
  2. Push branch “live” to show code.
  3. Rebase on origin, make changes/re-write history in the process.
  4. My code has now diverged from my own remote code.

Is push –force the appropriate solution to this?

  • 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-11T18:39:20+00:00Added an answer on June 11, 2026 at 6:39 pm

    Rewriting history will be a headache for anyone who pulled your repo and made their own changes based on your branches. When you rewrite your remote history and the downstream people pull it, their changes will end up dangling off in the middle of nowhere. (Check out the Recovering from an upstream rebase section of the git rebase docs.)

    That’s why if other people are using your repo, it would generally be better to merge changes from origin into live and push the merge. It’s not as clean as a rebase, but no one downstream will need to do funky things to keep up with your rewrites:

    git checkout live
    git merge --no-ff origin/whatever
    git push origin live
    

    You can always rebase when you’re ready to pull the changes in live back into the main branch.

    On the other hand, if you’re the only one using your repo, or the people downstream are ok with fixing remote history rewrites, --force away.

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

Sidebar

Related Questions

Something (who knows, possibly even me, though certainly not intentionally) has changed the keyboard
Something wrong is going on with one of the files in my local git
Something that seems to be absent from the otherwise great new features for Windows
Something that I think is really strange is happening when I use die() .
Something went wrong with my code. The insert code does not work. Can someone
Something that happens to me a lot while web programming: I want to run
Something like the following will not give me a compile-time or runtime error and
Something which doesn't take up too much memory that always listens to the pageurl
Something like my_model.data_dict['my_field'] Which would give you the current value for that field? Need
Something happens in my system on a worker thread. Let's say that the state

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.