4.7 KiB
How to Use GitHub
Contributing to the AREDN Project
Create Your GitHub Account
To contribute to the AREDN project you first must create your own GitHub account. This is free and easy to do by following these steps:
- Open your web browser and navigate to the GitHub URL
https://github.com
. - Click the
Sign Up
button and enter a username, email, and password. We suggest using your callsign as the username. - On the GitHub website, click the
Sign In
button and enter your username or email, followed by your github password. - You can enter "aredn" into the search bar to find all repositories related to AREDN, or if you want to contribute directly to the AREDN firmware you can type this URL into your web browser:
https://github.com/aredn/aredn_ar71xx
.
Understanding GitHub Workflow
The process of contributing and tracking changes to AREDN is circular. Code is maintained in the AREDN Master repository on GitHub. To contribute a potential code update, you must first FORK the AREDN master repository to your own GitHub account. You then CLONE your copy of the code from your GitHub repository to your own local computer. Make and test any changes you want to contribute using your local computer's copy of the code.
When you are satisfied with your changes, COMMIT them to your local computer's repository, then PUSH those local changes to your copy of the code on your own GitHub account. Finally, create a PULL REQUEST, which tells the AREDN development team that you would like your changes to be reviewed for inclusion in the AREDN Master repository.
One-time Repository Setup:
- Login to your own GitHub account and navigate in your browser to
https://github.com/aredn/aredn_ar71xx
- Click the
Fork
button on the upper right side of the page. You now have a copy of the AREDN source code on your own GitHub account. - Go to your local computer and copy your fork of the AREDN source code:
git clone https://github.com/myCall/aredn_ar71xx
cd aredn_ar71xx
This directory contains your local copy of the AREDN source code. The following commands will be executed while you are in this directory or its subdirectories.git remote add aredn https://github.com/aredn/aredn_ar71xx
Now your local environment knows about both the master code repository and your forked copy on your GitHub account.
Ongoing Development Cycle:
- Update your local environment with the latest code changes from the rest of the community, which will include any changes you had previously submitted. Caution: never make code changes directly on the
develop
branch. This will result in inconsistencies between the main repository and your repository, requiring a force-remove of any changes you have made.git checkout develop
git pull aredn develop
- Create a git code branch to fix a bug or implement a new feature:
git checkout -b my-wiz-bang-feature-name
- Make your changes and test them.
- When ready to submit changes, check to see whether they still work with code others have recently submitted. In GitHub terminology, “pull” down the latest changes and “rebase” or move your code on top of the latest. In this process you might find conflicts with someone else’s code, making further merge edits necessary.
git stash
to stash the changes still in process.git checkout develop
git pull aredn develop
git checkout my-wiz-bang-feature-name
git rebase develop
to move your branch and changes on top of the latest code others have submitted.git stash pop
to reapply your stashed changes- Resolve any conflicts that need to be merged if warned in the step above.
- Final build and validation that your changes work on top of the latest changes from all of the AREDN contributors.
Commit
your changes to your local repository, thenPush
the changes to your own GitHub repository.git commit
git push origin my-wiz-bang-feature-name
- Create a
Pull Request
(PR) to the AREDN master repository by browsing togithub.com/myCall/aredn_ar71xx
, then select the my-wiz-bang-feature-name branch. Click theNew Pull Request
button to generate your Pull Request. Others can now review your code, test it, and give feedback. If feedback is given and you need to make changes, go back to step 3. - Once your changes have been accepted into the AREDN master repository, delete your branch:
- On your local repository:
git branch -D my-wiz-bang-feature-name
- On your forked copy of your GitHub repository:
git push origin --delete my-wiz-bang-feature-name
- On your local repository:
You can continue contributing new features by beginning the development cycle again, starting with step 1 on the Ongoing Development Cycle.