Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

While Altium does not directly support Git for version control, we have devised a few workarounds to avoid any major issues. This document will describe the steps to setting up and using Git for the hardware repository. 

Setup

It is recommended that you use Git Bash for Windows. This provides a command line interface similar to a Linux or Unix based system. The following steps should help you clone our repository to your local folder. 

  1. Make sure that you are added to the Github repository, contact one of the team leads for this. 
  2. Create a new folder somewhere on your local machine, this will be where the repository is cloned to. It will also be the directory that you work from every time, it is recommended that you locate this somewhere easy to access. 
  3. Go to the hardware repository on github, locate the green Clone or Download button on the top right corner, and copy the link under Clone with HTTPS
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 

elec_##_projectname


Creating and Working with Branches

1. Create a local branch 

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. 

git commit -m'ELEC-### Commit message' 

3. Then you can push all your local changes to the repository

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: 

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. 

 


  • No labels