Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How exactly do you merge PRs? #256

Open
nexdrew opened this issue Oct 8, 2015 · 6 comments
Open

How exactly do you merge PRs? #256

nexdrew opened this issue Oct 8, 2015 · 6 comments

Comments

@nexdrew
Copy link

nexdrew commented Oct 8, 2015

I know you rarely use the "Merge pull request" button in GitHub, and I see you use Tower.

  1. What do you do to keep your commit history so clean?
  2. Is this roughly correct?
    1. Fetch the PR branch locally:

      git fetch origin pull/ID/head:pr/ID

    2. If PR contains N commits, squash them into one:

      git checkout pr/ID
      git rebase -i HEAD~N

    3. Cherry pick the squashed PR commit into master:

      git checkout master
      git cherry-pick -e pr/ID

    4. Prepend "Close #ID PR: " to the commit message and complete the cherry pick

    5. Run tests and push master

  3. Do you use a tool (e.g. Tower, apply-pr, or one of your own modules) to make this process easy?

learn-ways-of-the-force

@booee
Copy link

booee commented Oct 30, 2015

👍 Been wondering this as well

@Arkni
Copy link

Arkni commented Nov 4, 2015

@nexdrew

Maybe the jQuery Repository Maintainers Guide can help you :)

@nexdrew
Copy link
Author

nexdrew commented Nov 4, 2015

@Arkni Cool, thanks for the reference!

Found similar "rebase and merge --ff-only" strategy here via this SO answer, which can either preserve original commits or squash them before merging. Also aware of using hub and git am -3 as described here, but I haven't actually tried that.

I really just want to know how @sindresorhus does it. Still waiting patiently to find out. 😉

@igauravsehrawat
Copy link

@nexdrew May be he is waiting for your PR to describe it more efficiently. 😃

@kevva
Copy link

kevva commented Jan 18, 2016

I quite sure @sindresorhus uses https://github.com/github/hub to merge PRs etc.

@nexdrew
Copy link
Author

nexdrew commented Apr 1, 2016

https://github.com/blog/2141-squash-your-commits

@sindresorhus Does this mean you might be tempted to use the green button now? 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants