Login  Register

[PROPOSAL] How to merge a pull request

Posted by Jean-Baptiste Onofré on Aug 05, 2016; 12:27pm
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/PROPOSAL-How-to-merge-a-pull-request-tp18.html

Hi guys,

I discussed with Ravi how to cleanly merge a pull request, eventually
applying changes, keeping the original commit author, etc.

I proposed a procedure:

https://github.com/apache/incubator-carbondata/pull/63#issuecomment-237817370

For convenience, let me paste the proposal here:

Prerequisite

Assuming, you cloned the Apache git repo:

git clone https://git-wip-us.apache.org/repos/asf/incubator-carbondata
I advise to rename origin remote as apache:

git remote rename origin apache
Now, let's add the github remote:

git remote add github https://github.com/apache/incubator-carbondata
For convenience, we add a new fetch reference for the pull requests:

git config --local --add remote.github.fetch
'+refs/pull/*/head:refs/remotes/github/pr/*'
Then, we can fetch all, including the pull requests:

git fetch --all
Pull Request Branch

Now, we are ready to checkout a pull request in a specific branch:

git checkout -b pr-63 github/pr/63
You are now on the pull request (#63) branch: you can review and test
the pull request (building with Maven, verify, ...).

Then, you can amend the commit, squash several commits in one, rebase,
etc. Basically, it's where you are preparing the merge.

Merging the Pull Request

Once the pull request branch is ready, you can merge on master:

git checkout master
git merge --no-ff -m "[CARBONDATA-140] This closes #63" pr-63
git push
Once the merge has been done, you can delete the pull request branch:

git branch -D pr-63


Thoughts ?

Regards
JB
--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com