When submitting a pull request (PR), please use the following guidelines:
druid_intellij_formatting.xml
.eclipse_formatting.xml
.You can find more developers' resources in dev/
directory.
Fork the apache/druid repository into your GitHub account
Clone your fork of the GitHub repository
git clone git@github.com:<username>/druid.git
replace <username>
with your GitHub username.
Add a remote to keep up with upstream changes
git remote add upstream https://github.com/apache/druid.git
If you already have a copy, fetch upstream changes
git fetch upstream master
Create a feature branch to work in
git checkout -b feature-xxx remotes/upstream/master
Before submitting a pull request periodically rebase your changes (but don't do it when a pull request is already submitted)
git pull --rebase upstream master
Before submitting a pull request, combine (“squash”) related commits into a single one
git rebase -i upstream/master
This will open your editor and allow you to re-order commits and merge them:
s
(squash) or f
(fixup) to merge extraneous commits.Submit a pull-request
git push origin feature-xxx
Go to your Druid fork main page
https://github.com/<username>/druid
If you recently pushed your changes GitHub will automatically pop up a Compare & pull request
button for any branches you recently pushed to. If you click that button it will automatically offer you to submit your pull-request to the apache/druid repository.
Addressing code review comments
Address code review comments by committing changes and pushing them to your feature branch.
git push origin feature-xxx
If your pull request shows conflicts with master, merge master into your feature branch:
git merge upstream/master
and resolve the conflicts. After resolving conflicts, push your branch again:
git push origin feature-xxx
Avoid rebasing and force pushes after submitting a pull request, since these make it difficult for reviewers to see what you've changed in response to their reviews. The Druid committer that merges your change will rebase and squash it into a single commit before committing it to master.
Never fear! If you occasionally merged upstream/master, here is another way to squash your changes into a single commit:
First, rename your existing branch to something else, e.g. feature-xxx-unclean
git branch -m feature-xxx-unclean
Checkout a new branch with the original name feature-xxx
from upstream. This branch will supercede our old one.
git checkout -b feature-xxx upstream/master
Then merge your changes in your original feature branch feature-xxx-unclean
and create a single commit.
git merge --squash feature-xxx-unclean git commit
You can now submit this new branch and create or replace your existing pull request.
git push origin [--force] feature-xxx:feature-xxx