Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic merge of pull requests on Github without the merge bubble

Tags:

git

github

The "This pull request can be automatically merged [Merge pull request]" button in github is great -- except that it creates merge bubbles.

Is there a way to use this button/functionality in github without it creating merge bubbles?

like image 423
Marco Avatar asked Apr 03 '12 13:04

Marco


People also ask

Do pull requests automatically merge?

With auto-merge, pull requests can be set to merge automatically when all merge requirements are met. No more waiting on slow CI jobs or tests to finish just so you can click the merge button!

Can I close pull request without merging?

You may choose to close a pull request without merging it into the upstream branch. This can be handy if the changes proposed in the branch are no longer needed, or if another solution has been proposed in another branch.

Does git merge automatically pull?

Since your local commit isn't on the remote repository yet, when git pull runs git merge origin/[branch] [branch] , it will automatically do a "recursive" merge and create a commit with the remote changes.


2 Answers

No.

The git blog says using this button you always get an --no-ff merge (no fast-forward merge).

You'd have to do a manual merge if you don't want merge bubbles:

git checkout master git remote add cameronmcefee git://github.com/cameronmcefee/Spoon-Knife.git git fetch cameronmcefee  git merge cameronmcefee/my-branch git push origin master 
like image 100
Izhaki Avatar answered Oct 13 '22 21:10

Izhaki


And.. they fixed it!

See GitHub's blog on squashing your merge commits

If you go to the settings for your repository, you'll see a "Merge Button" section (under Options). It will have 2 buttons available:

Allow merge commits
Add all commits from the head branch to the base branch with a merge commit.

and

Allow squash merging
Combine all commits from the head branch into a single commit in the base branch.

If you uncheck the first option (and left the Allow squash merging checked), PR "merges" will result in rebase and squashes.

like image 22
Marco Avatar answered Oct 13 '22 21:10

Marco