REF.: Git Book - 6.2 GitHub - Contributing to a Project
-
Fork the project.
-
Create a new branch from
main
with a descriptive name, starting eventually with an issue number. -
Make some changes and commit them to improve the project.
-
Push this branch to your GitHub project.
-
Open a Pull Request on GitHub.
-
Discuss, and optionally continue committing.
-
The project owner merges or closes the Pull Request.
-
Sync the updated
main
back to your fork.
-
Clone a fork of the project locally.
git clone https://path-to/the-project.git
-
Create a descriptive topic branch and switch to it.
git checkout -b <new-feature> # or git switch -c <new-feature>
-
Make your change to the code.
-
Check that the change is good.
-
Add and commit the change to the topic branch.
(Note: Use imperative present tense for commit messages.)git add . git commit -m 'Change XYZ' # or git commit -a -m 'Change XYZ' # or git commit -am 'Change XYZ'
-
Push your new topic branch back up to your remote fork.
git push origin <name-of-branch>
-
Continue from step
5
in the The GitHub Flow above.