Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Typos and minor grammar/readability fixes.

...

  • cd nuttx
  • git checkout -b mybranch origin/dev

Clones are of repositories are useful was of for creating patches the that you can send to the Apache project for inclusion.  A better workflow, however, would use pull requests and to use pull requests you will need to use a fork instead of a clone.

Make your modification and commit it.

Forking the RepositiesRepositories:  A fork of the respository repository is a clone of the origin repository that exists in your remote github GitHub user area.  The "fork & pull" model lets anyone fork an existing repository and push changes to their personal fork without requiring access be granted to the source repository.  The changes must then be pulled into the source repository by the project maintainer. This model reduces the amount of friction for new contributors and is popular with open source projects because it allows people to work independently without upfront coordination.

...

To create a fork of your repository, follow these steps (from https://help.github.com/en/github/getting-started-with-github/fork-a-repo):

  • Create the fork by visting visiting the https://github.com/apache/incubator-nuttx/.  In the upper right corner, there is a button labeled Fork.  Follow the instructions and this will create a repository in your personal area at https://github.com/<username>/incubator-nuttx.
  • Create a local clone of your fork.  On you your local PC execute 'git clone <URL>' to create a clone of your fork on your local PC.  You can find the exact URL for of that URL command by visting visiting https://github.com/<username>/incubator-nuttx and clicking on the Clone or download button.

It may be useful to define a remote name for the original repository.  You will need this later when you re-syncrhonize synchronize your clone:

  • Check if they the list of remotes that you have already:

git remote -v
origin https://github.com/<username>/incubator-nuttx.git (fetch)
origin https://github.com/<username>/incubator-nuttx.git (push)

  • Add the NuttX remote:

git remote add upstream https://github.com/apache/incubator-nuttx.git

...

Committers Only.  It is especially important that NuttX committers use forks rather and than clones for code modification.  Committers have write privileges directly into NuttX repositories and so also bear the responsibility of being especially careful not to accidentaly accidentally make unauthorized modifications to the repositories. If committers use GIT clones of the NuttX repositories, then there is the constancy constant risk to of an error an inadvertantly that inadvertently modifies the upstream repositories.  When the committer functions as a contributor, this reponsibilities responsibility is best supported by using a safe fork and rather than an uncontrolled clone.

...

Generating Patches from a Clone.  If you are working from a clone of the repository, yuo you can create a patch using this GIT command:

...

Generating Pull-Requests from a Fork.  If you are working on a fork, you have the options option of creating a Pull-Request (PR) instead.  To create a pull request on a fork, do the following stegs steps (from https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork):

...

After your Pull-Request has been accepted, you will need to syncrhonize synchronize your fork with the upstream.  Instructions for doing this are available here: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-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 forfork, using a new name for the forked repository, of course.

It is a common practice to delete a fork after the pull-request has been closed.  Github GitHub even supports a special shortcut to delete your fork.  After the  you 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:

...