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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:47:22+00:00 2026-06-09T12:47:22+00:00

I have a git repository with master and alt branches. alt branch contains modified

  • 0

I have a git repository with master and alt branches. alt branch contains modified version of master code, and i am trying to merge changes from master to alt like this:

git merge --squash master

Merge results in conflict:

Auto-merging myproject/foo/bar
CONFLICT (content): Merge conflict in myproject/foo/bar
Squash commit -- not updating HEAD
Automatic merge failed; fix conflicts and then commit the result.

After I resolve conflicts and commit changes everything seems fine, but when i run git merge --squash master again (without doing any changes on any branches) i will get same conflict error.

Why is that? What did i miss?

  • 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-09T12:47:23+00:00Added an answer on June 9, 2026 at 12:47 pm

    By squashing the merge, you’ve created a commit which has the effect of, but is not really, a merge.

    That is, the working tree has the modifications you’d expect, but the metadata doesn’t: crucially, the commit doesn’t have two parents (one on master and one on alt) and therefore subsequent merges can’t figure out the last common ancestor.


    Useful uses of squash

    1. merging a completely finished feature branch onto master. I’ll accumulate any useful information into the squashed commit, but specifically don’t want this feature’s incremental development history polluting the master commit timeline.
    2. merging several independent features (or contributions from different developers) onto the same integration branch, again without preserving their incremental histories. I could rebase them all together, and then use rebase -i to squash their commits, but this is easier

    Useless uses of squash

    Any merge where you want to keep the history and ancestry metadata intact, such as any time you want repeated recursive merges to work correctly, specifically what the OP is trying to do.

    squash just isn’t really a good default, which is why it isn’t the default.

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

Sidebar

Related Questions

I have two branches in my Git repository: master seotweaks (created originally from master
I have a git repository and two branches master and st (branched from master
I have a git repository (at github.com) with two branches: master and gh-pages. I
I have a Git repository which I have started to develop on master branch
If I have a public Git repository that contains 3 branches like the following:
I have a Git repository with two branches: master and redesign . The redesign
I have a Git repository which has a master branch. Now I want to
I have a Git repository with 'master' branch. Some time ago (few months), we
I have a git repository with 2 branches: master and test. There are differences
I have a git repository that I'm trying to delete all files and folders

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.