Hi,

For others who are merging PRs from GH, I wanted to share what I was doing:

#1 - I have setup the following remotes

[~/dev/mynewt/core]$ git remote -v
github  https://github.com/apache/incubator-mynewt-core (fetch)
github  https://github.com/apache/incubator-mynewt-core (push)
origin  g...@github.com:sterlinghughes/incubator-mynewt-core.git (fetch)
origin  g...@github.com:sterlinghughes/incubator-mynewt-core.git (push)
upstream https://git-wip-us.apache.org/repos/asf/incubator-mynewt-core.git (fetch) upstream https://git-wip-us.apache.org/repos/asf/incubator-mynewt-core.git (push)

This contains my working clone (origin), the GitHub mirror (github) and the ASF maintained git repo (upstream.)

#2 - I work off origin for my commits and PRs

#3 - To merge other people’s PRs, I have the following script:

[~/dev/mynewt/core]$ more ~/dev/scripts/merge-pr
#!/bin/bash

git fetch github pull/$1/head:$2
git merge --no-ff -m "This closes #$1" $2
git branch -D $2
git push upstream develop


Which is called like so:

[~/dev/mynewt/core]$ merge-pr 178 harden-fs-checks

And goes ahead and fetches the remote pull request, and pushes it to upstream develop. If you want to avoid automatic pushes, comment out the git push upstream develop.

Sterling

Reply via email to