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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:20:07+00:00 2026-05-27T20:20:07+00:00

I have here a git repository with a few people working on it. I’ve

  • 0

I have here a git repository with a few people working on it.
I’ve set up branch.master.rebase = true and branch.master.mergeoptions = --no-ff, but I have came across a problem:

Someone tried to merge a feature branch into master. The merge was successful, and git said the branch was 30 commits ahead of origin/master. When he tried to push the changes, git rejected the push because there where changes in the remote, so he had to git pull. When he did the pull, git made a rebase for the commits that where merged into master, and now it was only 29 commits ahead of master.

I believe the merge commit was lost, because after the rebase, the commits where reapplied as new commits, and not commits that came from the feature branch.

After the push, the tree was like that:

* c3'(head, master, origin/master)
* c2'
* c1'
|  * c3 (feature_branch, origin/feature_branch)
|  * c2
|  * c1
| /
*

That is what I was trying to achieve:

* c4 (head, master, feature_branch, origin/master)
| \
|  * c3 (origin/feature_branch)
|  * c2
|  * c1
| /
*

The merge looked like a fast-forwarding merge, what I’m trying to avoid, to keep branching history.

Any tips on what I can do to avoid this?

Thanks,

Edit:
This article descibes my problem:
http://notes.envato.com/developers/rebasing-merge-commits-in-git/

Now I’m aware of the –preserve-merges option for git rebase, but is there a way to make this option default?

Otherwise, the developers would have to git fetch and git rebase origin/master instead of just git pull.

  • 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-27T20:20:07+00:00Added an answer on May 27, 2026 at 8:20 pm

    Why do you use branch.master.rebase = true if you want to save all branching history?

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

Sidebar

Related Questions

I have a Git repository with 'master' branch. Some time ago (few months), we
I am working on a git repository with a master branch and another the
Here's the situation... I need to be able to rebase a git repository branch
It's possible that I'm not really understanding how git works here, but I have
I've read a few git questions here, but could not find an answer to
I have a number of branches in a git repository: david@Panama ~/app: git branch
I have a git repository with 2 branches: master and test. There are differences
I have setup hudson to check out from my remote git repository but i
Here's the situation: We have a git repository, managed by gitosis. One user user
So here's the situation. I have a git repository with multiple submodules. Both the

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.