DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| Code Block | ||
|---|---|---|
| ||
git format-patch -<n> <sha> |
This will create a patch set based on the last number of commits <n> starting at the commit <sha>. Or
| Code Block | ||
|---|---|---|
| ||
git format-patch -<n> HEAD |
which will create a patch set starting at the HEAD of the branch. You can use git log --oneline origin/master..master | wc -l to help you get the number of commits.
REVISIT: How does wc -l work in other OSs such as Windows? There is this https://superuser.com/questions/959036/what-is-the-windows-equivalent-of-wc-l Drop the last phrase if not important.
If you have changes on a separate branch, then you can use the following to create the patches.
| Code Block | ||
|---|---|---|
| ||
git format-patch master # Assuming the base branch is master. |
The generated patch set should be sent to dev@nuttx.apache.org. To make sure that your patch email is noticed, please start the subject line with [PATCH] and a brief description. It is best to send the patch as an attachment with a .txt extension, as that ensures it gets the correct MIME type and isn't blocked by the mailing list's spam filter.
Your patch will be reviewed by the community and incorporated when everything is okay. If a change is required, address that and provide another patch.
Getting to this point your patch has been accepted and pushed to the main repository.
Now, you need to re-synchronize your local clone. It's important to note that committers can perform some minor changes on your behalf, so always pull the latest changes.
If you were working on a branch, just delete the branch and pull master. You can do this with the following GIT commands.
| Code Block | ||||
|---|---|---|---|---|
| ||||
git checkout master # Switch to master if not already there.
git branch -D <branch_name> # Since the branch has commits that weren't merged,
# GIT will complain if you try to delete the branch with -d
# Thus, force it with -D
git pull origin master # Fetch the latest changes from remote
# and merge them to your local repository. |
If you were working on master, reset the HEAD back to where origin was and pull master.
| Code Block | ||||
|---|---|---|---|---|
| ||||
git reset --hard origin/master # Reset back to origin.
git pull origin master # Fetch the latest changes from remote
# and merge them to your local repository. |
Generating a GitHub Pull-Request from a Fork
If you are working on a fork, you have the option of creating a Pull-Request (PR) instead. To create a pull request on a fork, do the following steps (from https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork):
- Make your your changes on a branch (or even on master) and commit the change to your local clone of the fork using
git commit - Push your changed code to your private fork:
git push origin <branch_name>where<branch_name>may be master. - Then visit your fork at http://github.com/<username>/incubator-nuttx
- To the right of the Branch menu, click New pull request and follow the instructions.
Your changes will now show up as Pull Requests in the original NuttX repository at https://github.com/apache/incubator-nuttx
After your Pull-Request has been accepted, you will need to synchronize your fork with the upstream. This will differ slightly depending on whether you were working on a branch or on master.
If working on a separate branch, follow these GIT commands:
master |
The generated patch set should be sent to dev@nuttx.apache.org. To make sure that your patch email is noticed, please start the subject line with [PATCH] and a brief description. It is best to send the patch as an attachment with a .txt extension, as that ensures it gets the correct MIME type and isn't blocked by the mailing list's spam filter.
Your patch will be reviewed by the community and incorporated when everything is okay. If a change is required, address that and provide another patch.
Getting to this point your patch has been accepted and pushed to the main repository.
Now, you need to re-synchronize your local clone. It's important to note that committers can perform some minor changes on your behalf, so always pull the latest changes.
Here are the GIT commands that will help you do that:
| Code Block | ||||
|---|---|---|---|---|
| ||||
git checkout master # Switch to master branch
git branch -D <branch_name> # Since the branch has commits that weren't merged,
# GIT will complain if you try to delete the branch with -d
# Thus, force it with -D
git pull origin master # Fetch the latest changes from remote
# and merge them to your local repository. |
Generating a GitHub Pull-Request from a Fork
If you are working on a fork, you have the option of creating a Pull-Request (PR) instead. To create a pull request on a fork, do the following steps (from https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork):
- Make your changes on a branch and commit the change to your local clone of the fork using
git commit - Push your changed code to your private fork:
git push origin <branch_name> - Then visit your fork at http://github.com/<username>/incubator-nuttx
- To the right of the Branch menu, click New pull request and follow the instructions.
Your changes will now show up as Pull Requests in the original NuttX repository at https://github.com/apache/incubator-nuttx
After your Pull-Request has been accepted, you will need to synchronize your fork with the upstream. You can do this with the following GIT commands:
| Code Block | ||||
|---|---|---|---|---|
| ||||
git checkout master | ||||
| Code Block | ||||
| ||||
git checkout master # Switch to master branch git branch -D <branch_name> # Delete the local branch git push -d origin <branch_name> # Delete the remote branch git fetch upstream # Get latest changes from upstream git merge upstream/master # Merge changes with the local master git push origin master Switch to master branch git branch -D <branch_name> # SynchronizeDelete the private fork |
If working on master:
| Code Block | ||||
|---|---|---|---|---|
| ||||
git reset --hard upstream/master # Reset back to upstream.local branch git push -d origin <branch_name> # Delete the remote branch git fetch upstream # Get latest changes from upstream git merge upstream/master # Merge changes with the local master git push origin master # Synchronize the private fork |
...
Often, a fork will diverge too much from the upstream repository to keep in synchronization properly. In this case, feel free to create a new private fork, removing the old forked repository first, of course.
It is a common practice to delete a fork after the pull-request has been closed. GitHub even supports a special shortcut to delete your fork. After the your PR has been closed, go to the https://github.com/apache/incubator-nuttx/pull/NN page (where NN is the PR number that was assigned to your pull request). You will see this message on that page:
...