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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:53:09+00:00 2026-06-15T23:53:09+00:00

I start some work on a topic branch •-•-• < topic / •-• <

  • 0

I start some work on a topic branch

    •-•-• < topic
   /
•-•       < master

I push the topic branch

$ git push origin topic

Someone else pushes changes to master

    •-•-• < origin/topic
   /
•-•-•—•   < origin/master

How do I update my local master and rebase my topic?

History should look like this

        •-•-• < topic
       /
•-•-•—•       < master

What I am trying

; update master
$ git checkout master
$ git fetch origin
$ git merge --ff-only origin/master

; rebase topic
$ git checkout topic
$ git rebase master

The problem

All of my commits on topic are seen as uncommitted. So when I try git push origin topic, I get

 ! [rejected]        topic -> topic (non-fast-forward)
error: failed to push some refs to '/path/to/repo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

The solution?

Please note, I do not want to merge my topic branch with master. I’d simply like to get my local repo updated without having to merge branches unnecessarily.

  • 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-15T23:53:10+00:00Added an answer on June 15, 2026 at 11:53 pm

    Let me rework your example for clarity.

        C-D-E < topic, origin/topic
       /
    A-B < master, origin/master
    

    Then someone does work.

        C-D-E < topic, origin/topic
       /
    A-B-F-G < origin/master
      ^
    master
    

    You fetched F & G from origin, and then rebased topic onto master. So now your repository looks like this.

        C-D-E < origin/topic
       /
    A-B-F-G < master, origin/master
           \
            C'-D'-E' < topic
    

    And this is the problem. origin/topic at E can not be fast-forwarded to topic at E’. Rebase is really only meant for commits that have not been pushed to origin. Since you pushed C, D, and E to origin/topic already, you would have to rewrite history on the remote repository. Hence the error. So you really have three options:

    1. Stop pushing a topical branch. If it’s only you who is working on topic, there’s no need to push it. Just keep rebasing topic on top of master, and when done, fast-forward merge master to topic & push master. Delete local topic branch. Voila!

    2. Merge topic & master. If you need to collaborate on a topical branch, you should probably suck it up and merge.

    3. Force the remote rebase:

      git push origin topic -f

      This will force origin/topic to E’. Except by re-writing history in the remote repository, you’ll have fire and brimstone, human sacrifice, dogs and cats living together, mass hysteria… and your fellow developers not liking you very much. Not recommended at all.

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

Sidebar

Related Questions

I am planning to start some Java mobile phone development. I downloaded the wireless
I wrote an init script to execute last that will start some pythjon script.
I'll start with some classes... The Domain Entity: public class Account { public int
I am trying to start writing some simple jQuery plugins and for my first
I have a console project which I want to start with some parameters argc
I'm writing script in remote.ini The script looks like on 1:start:{ server some.irc.server server
Title probably doesn't make a lot of sense, so I'll start with some code:
I'm working with intelliJ and my problem is when I start to import some
i create some project but when start App. How to Run this App one
My app some times crashes at start-up. In stack-trace only messages from built-in frameworks.

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.