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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:58:04+00:00 2026-06-09T19:58:04+00:00

My Git repository has two files, alpha and beta , with identical content. If

  • 0

My Git repository has two files, alpha and beta, with identical content.

If I delete alpha in my master branch, and edit it in my feature branch, then when I merge master into feature, I’m warned about a conflict. Assume I resolve this by deleting alpha.

If I then rebase my feature branch onto master using git rebase master, alpha is deleted, but the changes I made to alpha on the feature branch are now applied to beta! I get a conflict warning but it’s happily resolved with an auto-merge without the commit being blocked for me to review.

Interestingly, if I do a git rebase -i and just accept the default, beta isn’t edited and I get to resolve the same conflict I resolved at merge time.

Three related questions then:

  1. Why does Git think the change I applied to one file should be applied to another, when the other hasn’t been edited by any commit?
  2. How can I avoid this sort of situation?
  3. Why is the behaviour different for an interactive rebase, even when I take the default options?

I’m running Git 1.7.9 on Cygwin on Win7. I’ve put a transcript on pastebin showing this starting with a git init in an empty directory, if anyone wants to see the details for themselves (I’m not posting it here due to length).

  • 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-09T19:58:05+00:00Added an answer on June 9, 2026 at 7:58 pm

    From the documentation for git-rebase:

    -m
    –merge
    Use merging strategies to rebase. When the recursive (default) merge strategy is used, this allows rebase to be aware of renames on the upstream side.

    When a file is deleted, Git considers that a candidate for a rename, and tries to apply the rebased patch to the corresponding renamed file. It sounds like it might have made a poor guess in your case.

    You can use the -m option to select a different merge strategy. For example, the resolve merge strategy may avoid this problem with auto-detecting renames (see git-merge for details on merge strategies).

    • 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 which has a master branch. Now I want to
I've got a Git repository that has some files with DOS format ( \r\n
my co-worker has just create a new branch in the git repository which we
Say I have a project in a git repository. The project has a branch
I have a git repository that I'm trying to delete all files and folders
I have two branches in my Git repository: master seotweaks (created originally from master
master branch has these files and folders (simplified): C:\Local\TickZoom\Project>ls file.txt name.txt public public branch
I have a Git repository with two branches: master and redesign . The redesign
I have a git repository and two branches master and st (branched from master
I have my Git repository which, at the root, has two subdirectories: /finisht /static

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.