Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


There are several ways to setup Git for committers and contributors. Contributors can safely setup Git any way they choose but committers should take extra care since they can push new commits to the trunk at Apache and various policies there make backing out mistakes problematic. To keep the commit history clean take note of the use of --squash below when merging into apache/trunk.


Table of Contents

Git setup

...

This describes setup for one local repo and two remotes. It allows you to push the code on your machine to either your GitHub repo or apache/hadoop GitHub repo. The ASF official repository is gitbox.apache.org, however, the repository can be writable from both GitBox and GitHub if you are a committer.  You You will want to fork GitHub's apache/hadoop to your own account on GitHub, this will enable Pull Requests of your own. Cloning this fork locally will set up "origin" to point to your remote fork on GitHub as the default remote. So if you perform `git push origin trunk` it will go to your fork.

To attach to the Apache git repo do the following:

...


Once you are ready to commit to the apache remote, you can create a PR.

How to create a PR

...

Push your branch to GitHub:

Code Block
git checkout feature/hadoop-xxxx
git fetch apache
git rebase apache/trunk # to make it apply to the current trunk
git push origin feature/hadoop-xxxx

...

  1. Go to your feature/hadoop-xxxx branch on Github. Since you forked it from Github's apache/hadoop it will default any PR to go to apache/trunk.
  2. Click the green "Compare, review, and create pull request" button.
  3. You can edit the to and from for the PR if it isn't correct. The "base fork" should be apache/hadoop unless you are collaborating separately with one of the committers on the list. The "base" will be trunk. Don't submit a PR to one of the other branches unless you know what you are doing. The "head fork" will be your forked repo and the "compare" will be your `feature/hadoop-xxxx` branch.
  4. Click the "Create pull request" button and name the request "HADOOP-XXXX" all caps. This will connect the comments of the PR to the mailing list and Jira comments.
  5. From now on the PR lives on github's apache/hadoop repository. You use the commenting UI there.

...

How to run Jenkins precommit job for a PR

The precommit job is run automatically when opened a PR and when there is any change in your branch.

How to create a PR (contributors)

...

How to run Jenkins precommit job for a PR

If you are a committer and want to run Jenkins precommit job manually, log in to to https://ci-hadoop.apache.org/job/hadoop-multibranch and run the job corresponding with the pull request ID. If there is no such job, click "Scan Repository Now" to scan the pull requests. If you are not committer, please create an empty commit on the your branch.

Merging a PR (

...

for committers)

In most cases, clicking the "Squash and merge button" is fine. Before merging the PR, the committer must check the title and the commit message, and fix them if needed. You can add "Signed-off-by", "Reviewed-by", and "Co-authored-by" when merging the commit.

...