浏览代码

CONTRIBUTING.md: add step-by-step instructions for submitting a PR (#1671)

* CONTIBUTING.md:  add step-by-step instruction for submitting a PR

* CONTIBUTING.md:  refine the step-by-step instructions

* CONTIBUTING.md:  try a collapsible

* CONTIBUTING.md:  separate prerequisites from the PR process itself

* CONTIBUTING.md:  bold summary block for the PR process

* CONTIBUTING.md:  try HTML-style bolding in the summary block

* CONTIBUTING.md:  "PR branch"->"temporary branch" + other clarifications

* CONTRIBUTING.md:  distill the GitHub sign-in process into a single step

* CONTRIBUTING.md:  oops! inconsistent branch name
Stephen Gold 3 年之前
父节点
当前提交
9f044022df
共有 1 个文件被更改,包括 80 次插入2 次删除
  1. 80 2
      CONTRIBUTING.md

+ 80 - 2
CONTRIBUTING.md

@@ -13,14 +13,92 @@ Check out the [Projects](https://github.com/jMonkeyEngine/jmonkeyengine/projects
 
 
 When you're ready to submit your code, just make a [pull request](https://help.github.com/articles/using-pull-requests).
 When you're ready to submit your code, just make a [pull request](https://help.github.com/articles/using-pull-requests).
 
 
-- Do not commit your code until you have received proper feedback.
 - In your commit log message, please refer back to the originating forum thread (example) for a ‘full circle’ reference. Also please [reference related issues](https://help.github.com/articles/closing-issues-via-commit-messages) by typing the issue hashtag.
 - In your commit log message, please refer back to the originating forum thread (example) for a ‘full circle’ reference. Also please [reference related issues](https://help.github.com/articles/closing-issues-via-commit-messages) by typing the issue hashtag.
 - When committing, always be sure to run an update before you commit. If there is a conflict between the latest revision and your patch after the update, then it is your responsibility to track down the update that caused the conflict and determine the issue (and fix it). In the case where the breaking commit has no thread linked (and one cannot be found in the forum), then the contributor should contact an administrator and wait for feedback before committing.
 - When committing, always be sure to run an update before you commit. If there is a conflict between the latest revision and your patch after the update, then it is your responsibility to track down the update that caused the conflict and determine the issue (and fix it). In the case where the breaking commit has no thread linked (and one cannot be found in the forum), then the contributor should contact an administrator and wait for feedback before committing.
 - If your code is committed and it introduces new functionality, please edit the wiki accordingly. We can easily roll back to previous revisions, so just do your best; point us to it and we’ll see if it sticks!
 - If your code is committed and it introduces new functionality, please edit the wiki accordingly. We can easily roll back to previous revisions, so just do your best; point us to it and we’ll see if it sticks!
 
 
 p.s. We will try hold ourselves to a [certain standard](http://www.defmacro.org/2013/04/03/issue-etiquette.html) when it comes to GitHub etiquette. If at any point we fail to uphold this standard, let us know.
 p.s. We will try hold ourselves to a [certain standard](http://www.defmacro.org/2013/04/03/issue-etiquette.html) when it comes to GitHub etiquette. If at any point we fail to uphold this standard, let us know.
 
 
-#### Core Contributors
+There are many ways
+to submit a pull request (PR) to the "jmonkeyengine" project repository,
+depending on your knowledge of Git and which tools you prefer.
+
+<details>
+    <summary>
+        <b>Click to view step-by-step instructions for a reusable setup
+        using a web browser and a command-line tool such as Bash.</b>
+    </summary>
+
+The setup described here allows you to reuse the same local repo for many PRs.
+
+#### Prerequisites
+
+These steps need only be done once...
+
+1. You'll need a personal account on https://github.com/ .
+   The "Sign up" and "Sign in" buttons are in the upper-right corner.
+2. Create a GitHub access token, if you don't already have one:
+  + Browse to https://github.com/settings/tokens
+  + Click on the "Generate new token" button in the upper right.
+  + Follow the instructions.
+  + When specifying the scope of the token, check the box labeled "repo".
+  + Copy the generated token to a secure location from which you can
+    easily paste it into your command-line tool.
+3. Create your personal fork of the "jmonkeyengine" repository at GitHub,
+   if you don't already have one:
+  + Browse to https://github.com/jMonkeyEngine/jmonkeyengine
+  + Click on the "Fork" button (upper right)
+  + Follow the instructions.
+  + If offered a choice of locations, choose your personal account.
+4. Clone the fork to your development system:
+  + `git clone https://github.com/` ***yourGitHubUserName*** `/jmonkeyengine.git`
+  + As of 2021, this step consumes about 1.3 GBytes of filesystem storage.
+5. Create a local branch for tracking the project repository:
+  + `cd jmonkeyengine`
+  + `git remote add project https://github.com/jMonkeyEngine/jmonkeyengine.git`
+  + `git fetch project`
+  + `git checkout -b project-master project/master`
+
+#### PR process
+
+1. Create a temporary, up-to-date, local branch for your PR changes:
+  + `git checkout project-master`
+  + `git pull`
+  + `git checkout -b tmpBranch` (replace "tmpBranch" with a descriptive name)
+2. Make your changes in the working tree.
+3. Test your changes.
+   Testing should, at a minimum, include building the Engine from scratch:
+  + `./gradlew clean build`
+4. Add and commit your changes to your temporary local branch.
+5. Push the PR commits to your fork at GitHub:
+  + `git push --set-upstream origin ` ***tmpBranchName***
+  + Type your GitHub user name at the "Username" prompt.
+  + Paste your access token (from prerequisite step 2) at the "Password" prompt.
+6. Initiate the pull request:
+  + Browse to [https://github.com/ ***yourGitHubUserName*** /jmonkeyengine]()
+  + Click on the "Compare & pull request" button at the top.
+  + The "base repository:" should be "jMonkeyEngine/jmonkeyengine".
+  + The "base:" should be "master".
+  + The "head repository:" should be your personal fork at GitHub.
+  + The "compare:" should be the name of your temporary branch.
+7. Fill in the textboxes for the PR name and PR description, and
+    click on the "Create pull request" button.
+
+To amend an existing PR:
+  + `git checkout tmpBranch`
+  + Repeat steps 2 through 5.
+
+To submit another PR using the existing local repository,
+repeat the PR process using a new temporary branch with a different name.
+
+If you have an integrated development environment (IDE),
+it may provide an interface to Git that's more intuitive than a command line.
+</details>
+
+Generic instructions for creating GitHub pull requests can be found at
+https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
+
+### Core Contributors
 
 
 Developers in the Contributors team can push directly to Main instead of submitting pull requests, however for new features it is often a good idea to do a pull request as a means to get a last code review.
 Developers in the Contributors team can push directly to Main instead of submitting pull requests, however for new features it is often a good idea to do a pull request as a means to get a last code review.