You are not Logged In!

Public:GitHub

From Illini Solar Car Wiki
Revision as of 00:30, 19 October 2018 by imported>Amalia
Jump to navigation Jump to search

{REMARKSBOX(type="note" title="Note")}This page is currently in development as is GitHub organization. This page currently exists to define how the github should operate. The GitHub will then be brought up to this spec. - Jonathan (23 Feb 18){REMARKSBOX}

Illini Solar Car has several git repositories used for different things. If you haven't set them up yet, read this: ((Github Setup)).

{TABS(name="git_repo_tabs" tabs="PCB|FW|Tutorials|Useful Commands")}

PCB

Our PCBs are developed in ((KiCad)) and are stored on GitHub. Our libraries are stored in a separate, public repository which is submoduled into the PCB repo.

In order to get the PCBs onto your computer, use -+git clone <repo> <nowiki>--</nowiki>recursive+-. The -+<nowiki>--</nowiki>recursive+- option looks for submodules in the repo and clones them into the correct directory. If this option was omitted during the initial clone, run the command -+git submodule update <nowiki>--</nowiki>init+- to find any un-cloned submodules and clone them.

Once you have the PCBs cloned onto your computer, you should be able to open them and edit them without any issues. If you have any trouble with this, either the project is setup incorrectly, or the repo was cloned incorrectly

The following describes the process for editing PCBs without changing libraries:

  • Edit the PCB files
  • Stage the changes for the next commit using -+git add <files>+-. To stage all changes use -+git add .+- or -+git add -a+-.
  • Commit the changes using -+git commit -m"<commit>". Include a useful message to help people reading through the history see what was done.
  • Push the changes to GitHub using -+git push+-

Editing libraries requires a different process, but it's the same whether editing them alone, or along with PCBs.

  • Edit the libraries and PCB files
  • Ensure your working directory is the -+Libraries+- directory. This is to ensure changes are being made to the library repo, instead of the PCB repo.
  • Stage(-+git add+-), commit(-+git commit+-), and push(-+git push+-) the changes as described above.
  • Change your working directory to the PCB repo
  • Stage your changes. Make sure -+Libraries+- is included or the changes in the libraries will not be seen by the PCBs.
  • Commit and push as above.

Whenever changes are made on another computer, you need to get the changes with the following process:

  • Pull the changes to the PCB files with -+git pull+-
  • Pull the changes to the library files with -+git submodule update --init+-. Make sure to do this step every time as it isn't always clear that libraries were changed and not doing it will make it impossible to open the PCBs

/////

FW (Firmware)

This repository is for the vehicle firmware (i.e. all on-board software and only on-board software). The organization of this repository will follow GitFlow. Please read more about GitFlow.

File:46

The above image shows the flow of GitFlow. We will utilize that system as follows:

Master

Hot Fix

Release

Development

Feature Branches

/////

Tutorials

Github manual

Another good Git reference

Github video guides

Intro to git 

Git branching

Git merge conflict resolution (a EE successfully followed these instructions)

I (Tony) didn't know where to put these but I wanted to get them on the wiki so they were here and people could see them. Feel free to edit this if I don't get around to it soon.

Lynda.com tutorial

http://www.ndpsoftware.com/git-cheatsheet.html

/////

Useful Commands

Moved from main elec page

To push a PCB you've just started working on

  • Checkout a new branch
  • Check the status
  • Add files you want to commit
  • Check the status
  • Commit the files
  • Push your changes

To start editing a PCB

  • Checkout the branch with the PCB
  • Edit the PCB

To push changes to a PCB that already exists

  • Check the status
  • Add files you want to commit
  • Check the status
  • Commit the files
  • Push your changes

Neither the PCB nor the FW repositories will let you push changes to master. When you finish a PCB, it needs to be merged using a pull request.

{TABS}