Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Merge + Squash does not change MERGE_HEAD?
Merge + Squash does not change MERGE_HEAD? [message #993721] Tue, 25 December 2012 08:39 Go to next message
Tal Weiss is currently offline Tal WeissFriend
Messages: 4
Registered: October 2011
Junior Member
When merging using "Squash" and later committing, Git history does not show the branch as merged.
My procedure:
In Pydev Package Explorer, right click on the project in the Master branch.
Team - Merge
Select a local branch
In the merge options select Squash
Click on the Merge button

The merge happens in my workspace without a commit (so far so good).

I review the code, possibly modifying it slightly and commit.
Commit works, but the branch is not really merged.
In the history view (or git log --decorate --graph --oneline) I don't see the merge.
When I try to delete the branch it tells me that it has unmerged commits.

Am I using merge-squash wrong?

[Updated on: Tue, 25 December 2012 08:40]

Report message to a moderator

Re: Merge + Squash does not change MERGE_HEAD? [message #998380 is a reply to message #993721] Wed, 09 January 2013 22:08 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1015
Registered: July 2009
Senior Member
EGit doesn't support merge-squash yet, so it looks like you used some other git implementation here.
Click "About Eclipse > Installation Details" and check if you installed the features org.eclipse.egit and org.eclipse.jgit.
You are using something else.
Re: Merge + Squash does not change MERGE_HEAD? [message #998548 is a reply to message #998380] Thu, 10 January 2013 08:09 Go to previous messageGo to next message
Stefan Lay is currently offline Stefan LayFriend
Messages: 342
Registered: July 2009
Senior Member
Matthias, the community is working hard;-) Squash was implemented by Tomasz in August last year.

Tal, in my opinion merge-squash works as designed. Please have a look at the git docu (

"Produce the working tree and index state as if a real merge happened (except for the merge information), but do not actually make a commit or move the HEAD, nor record $GIT_DIR/MERGE_HEAD to cause the next git commit command to create a merge commit. This allows you to create a single commit on top of the current branch whose effect is the same as merging another branch"

So, in a nutshell, merge-squash does not merge in the branch but only takes the changes introduced by the branch.
Re: Merge + Squash does not change MERGE_HEAD? [message #1067912 is a reply to message #998548] Thu, 11 July 2013 08:38 Go to previous message
Jochen Bleile is currently offline Jochen BleileFriend
Messages: 1
Registered: July 2013
Junior Member
I have some problems using the squash option during merge. In my understanding (when selecting the squash option) EGit should not commit the merge result automatically and the next commit should only have one parent. However, several times I experienced that EGit instead performed a normal merge (automatically commits the changes and the resulting commit has two parents). Even when I reset my branch and try again it is doing it the same way. I tried to figure out when EGit is doing it right and when not but I was not able to so far.

When using another tool (GitExtensions) it works always as expected even if EGit fails.

Does anyone else encounter this behaviour?
Previous Topic:Multi-threaded/Multiprocess Jgit use
Next Topic:GitServlet HowTo
Goto Forum:

Current Time: Fri May 25 01:39:21 GMT 2018

Powered by FUDForum. Page generated in 0.01373 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top