We recently onboarded ranger committers as reviewers on GitHub. Contributions initiated via a GitHub PR are now welcome. Here is how to navigate the process of raising a PR:
Initial Setup
Initiate a fork of apache/ranger. Note: A single fork is sufficient enough to be used for all development purposes.
git clone your fork in your local. This automatically creates a remote called origin.
Setting your upstream:
git remote add upstream https://github.com/apache/ranger.git
git remote set-url --push upstream disallowed (Optional: to prevent inadvertent push to apache master)
git remote -v (Optional: to check your remote configs)
git fetch upstream
Feature Development
If you’re working on a feature RANGER-XXX, you may create a local branch with
git checkout -b RANGER-XXX --track upstream/master
Do local changes and commit locally with
git commit -m "RANGER-XXX: <Commit Message>"
Push your commits to your fork with
git push origin HEAD:RANGER-XXX
- Use
git status
to check whether your branch is tracking an upstream one. This creates a new remote branch named RANGER-XXX on your fork and an option to create a PR is now visible.
The same command can be used to push subsequent commits, the PR automatically reflects the change if one exists.
Add reviewers(existing committers) and add yourself as an assignee.
Provide a description of the changes and testing performed (use the below template)
## What changes were proposed in this pull request? Description of your changes ## How was this patch tested? Mention testing performed
6. To checkout PRs locally for review:
Install
gh
via brew like this:brew install gh
. You may checkout a PR using this command:gh pr checkout <#pr>
. Do agit pull
when a PR has been updated.Alternatively, a patch/diff file for a PR can be viewed by appending .patch and .diff to the PR URL respectively. ex:
Merge & Rebase (Coming soon)
Merge
When the upstream master has moved ahead, it is time to bring in the changes via a merge
. This can be done using git merge master
. Conflicts may need to be resolved.