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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:57:52+00:00 2026-06-07T06:57:52+00:00

I have merged two of my branches (using the Eclipse merge tool). When I

  • 0

I have merged two of my branches (using the Eclipse merge tool).

When I commit, the commit has only one of the branches as parents (the original workspace HEAD). I’ll dig into why that happens later, but I need to commit this properly right now (there was lot of work involved in the merge).

How can i amend the commit to include the reference to the other branch? The file contents are all good now, I just want to have the commit have two parents.

  • 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-07T06:57:54+00:00Added an answer on June 7, 2026 at 6:57 am

    First, if you have already committed, run git reset --soft HEAD^ to undo it.

    Method 1

    Create MERGE_HEAD file in GIT_DIR (usually /.git) which contains SHA-1 of the tip of the branch (you can get it using git show-ref) you are merging with (and an empty line, just to mimic git merge behavior). And commit as usual.

    Method 2

    Also, you can do it without messing with git internals, if you prefer:

    • save copy of your working directory (without .git directory) somewhere
    • do git reset --hard
    • do git merge branch_to_merge_with --no-commit
    • remove everything from working directory (except .git directory)
    • restore working directory content from saved copy
    • add changes & commit

    P.S. it could happen if you’ve used git merge --squash option or MERGE_HEAD file was lost somehow.

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

Sidebar

Related Questions

I have two branches for which the merge was done using STS. Now we
I want to merge two branches that have been separated for a while and
I have two iterators which i have to merge into one result. Here are
I have two arrays. I'd like to merge them into one, but remove the
Is Mercurial always using the external merge tools when two branches that are merging
We have two branches. One is a Release Branch (RB) taken from the trunk.
I am using git and I have two branches: production and master. At this
I'm currently using TortoiseSVN to do a merge of two branches and I've found
I am using git for a large legacy project which has two branches -
I have merged two branches in a local Git repository, with a bunch of

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.