# Create a working directory
mkdir working
cd working
# Clone the apache repository
git clone https://git-wip-us.apache.org/repos/asf/hawq.git
# Add remote github mirror repository
git remote add github https://github.com/apache/hawq.git
# Get the pull request, using PR#2 as example, you can replace 2 with any other PR #.
git fetch github pull/2/head:feature_awesome
# Sometimes, the commits in the patch is based on old master
# So it needs to be rebased on current master
# For some cases, the committer should squash the commits in the branch into one commit
# And the original AUTHOR information should be kept to give credits to the contributor
git checkout feature_awesome
git rebase origin master
# Merge the patch (an alternative way to do this is to use "git cherry-pick")
git checkout master
git rebase feature_awesome
# Build
make
# Run tests (more in future before committing to “master” branch)
# Before run the following tests, you need to set up and start HDFS & HAWQ
# More setup details are at: https://cwiki.apache.org/confluence/display/HAWQ/Build+and+Install).
make installcheck-good
# In case of some contributor often forget to close pull request,
# Append commit message to automatically close pull request after code merged. e.g. PR number is 12:
run `git commit --amend` and append "(close #12)" in a new line to commit message.
# Push to apache repo (note: all commits needs an Apache JIRA)
git push origin master
# Delete the feature branch
# And close the JIRA & add comment in the pull request to ask the contributor to close the pull request
git branch -d feature_awesome
|