Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Documented that GitHub apache/hadoop is writable

This guide is optional for contributors. It is not necessary to use GitHub to contribute patches.

Note: This content was moved over from https://wiki.apache.org/hadoop/GithubIntegration

...

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 to apache/hadoop GitHub repo. The ASF official repository is gitbox.apache.org. You , however, the repository can be writable from both GitBox and GitHub. You will want to fork GitHub's apache/hadoop to your own account on GitHubon 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 on GitHub as the default remote. So if you perform `git push origin trunk` it will go to GitHubyour fork.

To attach to the Apache git repo do the following:

Code Block
git remote add apache https://gitboxgithub.apache.org/repos/asfcom/apache/hadoop.git


To check your remote setup:

...

Code Block
origin    https://github.com/your-github-id/hadoop.git (fetch)
origin    https://github.com/your-github-id/hadoop.git (push)
apache     https https://gitboxgithub.apache.org/repos/asfcom/apache/hadoop.git (fetch)
apache     https https://gitboxgithub.apache.org/repos/asfcom/apache/hadoop.git (push)


Now if you want to experiment with a branch everything, by default, points to your github account because origin is the. You can work as normal using only github until you are ready to merge with the apache remote. Some conventions will integrate with Apache Jira ticket numbers.

...


Once you are ready to commit to the apache remote, you can merge and push them directly or better yet create a PR.We recommend creating new branches under feature/ to help group ongoing work, especially now that as of November 2015, forced updates are disabled on ASF branches. We hope to reinstate that ability on feature branches to aid development.

How to create a PR (committers)

...

Merging a PR (yours or contributors)

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.

When you need to commit the change locally and push them, start Start with reading https://help.github.com/articles/checking-out-pull-requests-locally/.
Remember that pull requests are equivalent to a remote GitHub branch with potentially a multitude of commits. In this case it is recommended to squash remote commit history to have one commit per issue, rather than merging in a multitude of contributor's commits. In order to do that, as well as close the PR at the same time, it is recommended to use squash commits.

...