Branching
In git, "branches" are used to make changes to the code without affecting the main codebase or the work of other developers. Once the changes on a new branch have been tested and reviewed in a "pull request", the new branch is merged into the main codebase.
Getting Started
Note
Before you start writing new code, please create a new issue to describe what you are planning to do, and "assign" the issue to yourself. This lets other developers know what you are working on. See issues
-
Clone the pydarn repo:
git clone git@github.com:SuperDARN/pydarn.git
It is recommended by GitHub to create a SSH key
-
Change to the
pydarn
foldercd pydarn
-
Update the code
git fetch git pull origin main
-
Decide what branch to break off from:
- HOTFIX: a fix that needs to be in main ASAP then branch from
main
- Documentation: existing main documentation with an update then branch from
main
- New Documentation: documentation that doesn't exist in the main documentation then branch from
develop
- New code/fix that can wait for a release then branch from
develop
- Removing legacy code then branch from
develop
-
Code based on another branch then branch from that branch name
git checkout
- HOTFIX: a fix that needs to be in main ASAP then branch from
-
Decide on the new branch name. It is recommended to use the following Prefixes:
- HOTFIX/ : a bug that needs to be fixed ASAP and pushed to
main
- FIX/ : a bug fix that can wait to be released
- EHN/ : an enhancement or new feature to the
develop
code - DOC/ : new or updating existing documentation
-
DEP/ : deprecating code from the codebase
git checkout -b
- HOTFIX/ : a bug that needs to be fixed ASAP and pushed to
-
Now you have created your own branch locally. Make the modifications to the code on this branch, and then run the following commands to commit the changes:
git add <file changed> git commit -m <brief description of the change>
-
Now "push" the changes to GitHub:
git push origin <branch name>
-
Repeat the above commands above as you work on the code changes
- Once you have completed, documented, tested and updated the unit tests then you can create a pull request, see pull request