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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:46:13+00:00 2026-06-06T15:46:13+00:00

So I am on a branch called ‘test_branch’. I do git add . and

  • 0

So I am on a branch called ‘test_branch’.

I do git add . and git commit and everything works fine.

But when I do git push, it gives me the error :

! [rejected]        acceptance -> acceptance (non-fast-forward)
error: failed to push some refs to 'git@github.com:company/sample.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.

Doing git pull shows me that everything is up-to-date, and doing a push after that, gives me the same error as above.

Can somebody please help me with this ?

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-06-06T15:46:16+00:00Added an answer on June 6, 2026 at 3:46 pm

    When you type git push without any arguments, its behavior depends on the value of the push.default setting. The default value of push.default is matching, which, according to git help config, does the following:

    matching — push all branches having the same name in both ends. This is for those who prepare all the branches into a publishable shape and then push them out with a single command. It is not appropriate for pushing into a repository shared by multiple users, since locally stalled branches will attempt a non-fast forward push if other users updated the branch.

    In other words, if your local repository has a branch named acceptance and the remote repository has a branch named acceptance, then git push will try to make the remote acceptance branch match your acceptance branch even if you don’t have acceptance checked out.

    So, my guess is that you checked out acceptance at some point in the past, but someone else on the project (or maybe you from a different clone of the repository) pushed new commits to acceptance. This caused your local acceptance branch to be behind the remote acceptance branch. Now whenever you type git push, your Git tries to back up the remote acceptance branch to the version you have in your local repository.

    To fix, I recommend setting push.default to simple (or upstream if simple isn’t available in your Git version — it was only added in 1.7.11).

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

Sidebar

Related Questions

Somebody pushed a branch called test with git push origin test to a shared
I have several Git repositories that all have one branch called 'master.' But what
I have several Git repositories that all have one branch called 'master.' But what
I have a branch called experiment. git checkout master echo 'some changes' > a.txt
I've read this book section about git branches. I have create a branch called
I have a git branch that I have been working on called feature1 with
I created a tag on the master branch called v0.1 like this: git tag
It's possible that I'm not really understanding how git works here, but I have
I've got a npm-shrinkwrap.json and a package.json in a git branch called deployment. On
I accidentally created a branch called remotes/origin/remotes/origin/aclark and can't delete it with: git branch

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.