Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to git merge squash in Eclipse

Sometimes I need to merge squash from Eclipse. I know I can do it in command line, but it will be really useful to have graphic option integrated in Eclipse. Do you know how to do it?

like image 842
Kritana Avatar asked Jun 06 '14 08:06

Kritana


People also ask

How do you do squash and merge in Git?

Under your repository name, click Settings. Under "Pull Requests", select Allow squash merging. This allows contributors to merge a pull request by squashing all commits into a single commit.

How do I request a merge in squash?

Set default squash options for a merge request Users with permission to create or edit a merge request can set the default squash options for a merge request. To do this: Go to the merge request and select Edit. Select or clear the Squash commits when merge request is accepted checkbox.

How do I squash in Git?

In case you are using the Tower Git client, using Interactive Rebase to squash some commits is very simple: just select the commits you want to combine, right-click any of them, and select the "Squash Revisions..." option from the contextual menu.


1 Answers

You can start an interactive rebase in EGit, and select squash for the commits you want squashed.

http://wiki.eclipse.org/images/0/0b/Egit-3.2-InteractiveRebaseView.png


Note: for squashing the last few commits, historically the other way was a soft reset (see this thread)

  • select in history the first commit which I don't want to squash
  • right-click and say "Team->Reset->Soft"
  • right-click and say "Commit". This commit will contain all the changes of the last m commits together
like image 53
VonC Avatar answered Sep 19 '22 14:09

VonC