DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Clone the canonical ASF repo using this command. The --origin option tells git to name the remote apache instead of the default, origin; this will reduce ambiguity when we later add a second remote upstream:
git clone --origin apache https://git-wip-us.apache.org/repos/asf/incubator-corinthia.git |
|---|
Add a second remote, for the GitHub repository:
git remote add github https://github.com/apache/incubator-corinthia.git |
|---|
For the GitHub remote, add an additional fetch reference which will cause every pull request to be made available as a remote branch in your workspace:
git config --local --add remote.github.fetch '+refs/pull/*/head:refs/remotes/github/pr/*' |
|---|
Finally, run git fetch --all to update from all remote repositories - you will see all the pull requests appear:
refs/pull/98/head -> github/pr/98 refs/pull/99/head -> github/pr/99
Merging a pull request
Fetch the latest remote branches, which will cause a remote branch for the PR to become available to you.
git fetch --all |
|---|
If you want to inspect the PR and/or run tests, check out the branch:
git checkout github/pr/1234 |
|---|
To perform the merge, first update your master branch to the latest:
git checkout master git pull --rebase |
|---|
Then merge and push:
git merge --no-ff -m 'This closes #1234' github/pr/1234 git push apache master |
|---|
Note that this commit message is important, as this is what will trigger the pull request to be automatically closed, and the --no-ff means that a merge commit will always be created.
Alternative options
Adding the remote reference to the contributor' s repository
Fetch the branch of the user you want to merge from
git fetch https://github.com/user-to-merge-from/incubator-corinthia.git branch-to-merge-from |
|---|
If you commonly merge from a particular user, you'll want to add their repo as a remote:
git remote add user-to-merge-from https://github.com/user-to-merge-from/incubator-corinthia.git |
|---|
This makes fetching easier:
...
git <yourRepoName> |
|---|
Merging from a patch file
Save the patch from the Github patch link (just append .patch to the pull request link to get it). This patch will keep the authorship of the commit, so we should use it instead of the diff. Apply Apply the patch preserving the original author:
cd <yourRepoName> |
|---|
Quick git primer
Start with getting the repository and setting up:
git clone --origin https://git-wip-us.apache.org/repos/asf/incubator-corinthia.git cd incubator-corinthia git pull |
|---|
Applying one change:
...
co master |
|---|
Quick git primer for workflow
Assumes you have already cloned the git, and are going to start working on a patch.
Never work directly in master, every commit in master must be tested by running dftest.
In order to work, and have local commits (like "finished 1part, going out for lunch"), use the following recipe:
cd <yourRepoName> git co master |
|---|
git pull git branch -b work |
|---|
<do all your work, including several small commits>
| git commit -a -F ./your.logmessage |
|---|
dtest -plain to ensure all test cases still work>
git co master git merge --squash work git commit -a -F ../your.logmessage git push |
|---|
Additional Information
Particularly for new committers, you may find the following information useful:
- Pro Git: Free book available as HTML and PDF. Also available in other languages, please see the HTML version for a list.
- Guide for new project committers
- Committers FAQ
- Git at Apache
...