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

  • Home
  • SEARCH
  • 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 4250814
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:34:42+00:00 2026-05-21T04:34:42+00:00

I am trying to push to a remote repo but keep getting the error

  • 0

I am trying to push to a remote repo but keep getting the error below.

$ git push
To user@remote.net:/home/user/repos/remoterepo.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'user@remote:/home/user/repos/remoterepo.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.

git remote show origin shows master pushes to master (local out of date). I am positive that it shouldn’t be out of date as I push only from the branch.

I have 2 questions.

  1. is it possible to force the local branch to overwrite the remote? Pulling will overwrite the changes which are definitely later that the stuff in the repository.

  2. This is about the 2nd or 3rd time I have had this problem. The only thing I can think of that the local version of git is git version 1.7.3.1.msysgit.0 (on Windows)and the remote version is git version 1.6.5 (Ubuntu Jaunty).
    Is it possible that the different git versions may be causing some corruption?

  • 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-21T04:34:43+00:00Added an answer on May 21, 2026 at 4:34 am
    1. (see update below) yes, it is possible: git push --force. But do that only if you are absolutely sure that nobody has read the repo since the last push (see How do I push amended commit to the remote Git repository? for an in-deep discussion).
    2. To me, it seems more like you have to git pull first, before you’re able to push. I don’t think that it is a time related error. The message indicates that there are newer commits on the server (identified by their commit hash, not the commit date)… To see, what’s changed, do a git fetch instead of git pull and have a look at the changes using git log origin/master…

    Update: in the meanwhile, push learned the --force-with-lease option that ensures that you’re not accidently breaking something: https://developer.atlassian.com/blog/2015/04/force-with-lease/. Prefer this over --force whenever possible!

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

Sidebar

Related Questions

I've been trying to push my mentallity when developing at home to be geared
Hey! I am not trying to push my luck here but I have another
I am trying to save data to a database on a button push, but
I'm trying to push my changes to a repo on my NAS. It's failing
I am trying to follow this instruction. I have a local git repo and
Trying to keep all the presentation stuff in the xhtml on this project and
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
I have the following problem... I was trying to merge a remote branch into
I'm somewhat new to Git and what I'm trying to do seems like it
I'm trying to setup Gitolite but I'm running into a weird issue: When I

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.