...
Code Block | ||||
---|---|---|---|---|
| ||||
git clone https://github.com/uw-midsun/hardware.git |
Now you should have a copy of the repository on your local computer. This will then be the bases for any changes that you make.
Branches
Branches allow us to work on projects in parallel. There are two types of branches, master and feature branches. While working on your project, you should be working within your own feature branch only. While within this branch, you may commit as many times as you'd like. It is recommended that you commit whenever you're done working with it, or after making any major changes. This will allow you to easily revert to an earlier version if needed. When the board is complete and reviewed at a board review session, you may then push this branch to masters. Otherwise, you should never commit directly to master.
Note: Please make sure to name your branch in the following format, where ### is the JIRA ticket for the appropriate project
Code Block | ||
---|---|---|
| ||
elec_##_projectname |
Creating and Working with Branches
1. Create a local branch
Code Block | ||
---|---|---|
| ||
git checkout -b <branch-name> |
2. Make any changes to the files, then when you are ready to commit. Please make sure to tag your JIRA ticket (ELEC-###) in each commit. Also make sure that you have a meaningful message describing what you changed. You may also add a TODO to help you keep track of things if wished.
Code Block | ||
---|---|---|
| ||
git commit -m'ELEC-### Commit message' |
3. Then you can push all your local changes to the repository
Code Block | ||
---|---|---|
| ||
git push --set-upstream origin branch-name |
Now if you check on github, your changes should be present inside the branch you made.
Pull Requests
Pull requests are used to approve the changes that you made in your branch before merging that into the master branch. This will usually be done at a board review if it's a new PCB design. If it's a simple change that does not warrant a review, you may also contact a hardware lead on HipChat who can approve your PR.
Creating and Merging a PR
After making all your commits and making sure that it is ready to be merged into master, you may open a pull request on github. Make sure that you change the default comment to something meaningful, it should have the following format:
Code Block |
---|
Title: ELEC-###: JIRA Ticket Name
Comment:
What was added/changed in this revision
What components were added to the library
Any other comments regarding this revision |
Make sure that you tag the hardware leads as the Reviewers, and set any labels if you feel appropriate.