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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:22:57+00:00 2026-05-30T00:22:57+00:00

I pushed a change to a remote test git repo, then reset my local

  • 0

I pushed a change to a remote test git repo, then reset my local git repo to HEAD^, and now am trying to push my local repo to origin, but I get a “non fast forward” merger warning. If I do a git pull, my local repo gets nuked by the origin.

How can I either merge in the origin repo and tell it to throw away the merges from the origin or tell origin to accept my push, even though it is not a fast forward?

Thanks

  • 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-30T00:22:59+00:00Added an answer on May 30, 2026 at 12:22 am

    The GitHub help page does summarize it nicely:

    This error can be a bit overwhelming at first, do not fear.
    Simply put, git cannot make the change on the remote without losing commits, so it refuses the push.
    Usually this is caused by another user pushing to the same branch.
    You can remedy this by fetching and merging the remote branch, or using pull to perform both at once.

    In other cases this error is a result of destructive changes made locally by using commands like git commit --amend or git rebase.

    (In your case, a git reset --hard)

    While you can override the remote by adding --force to the push command, you should only do so if you are absolutely certain this is what you want to do.
    Force-pushes can cause issues for other users that have fetched the remote branch, and is considered bad practice.
    When in doubt, don’t force-push.

    The question “Git reset –hard and a remote repository” adds that you need to be aware of the potential remote config receive.denyNonFastForwards, which can deny your “git push --force“.
    In which case, some kind of revert needs to take place: alternatives are discussed at “GIT revert to previous commit… how?“.

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

Sidebar

Related Questions

Scenario: I have a remote git repo for a website, cloned to my local
So I've created a repo using Git Bash, and it works (Local and Remote
i deleted a folder from my local Git repository then i committed and pushed
I pushed some changes to our central git repository, and then immediately realized that
I created a tracking branch so whowasout.com tracked whowasout.com/master $ git remote -v origin
Possible Duplicate: git push error '[remote rejected] master -> master (branch is currently checked
I made acommit and pushed it to origin and heroku Then I realised it
Possible Duplicate: How git works when two peers push changes to same remote simultaneously
How do you change the git repository a rail app is pushed to? I
i have set up a bare repo on a remote server and can push

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.