You are not Logged In!

Difference between revisions of "Public:GitHub"

From Illini Solar Car Wiki
Jump to navigation Jump to search
imported>Amalia
imported>Amalia
(No difference)

Revision as of 03:33, 19 February 2019


{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 within our on GitHub. You must talk with an ((Electrical Lead|Electrical Group Structure)) so they can give you access to our private repositories. In general, many people use git via the command line. We use it almost exclusively, and you should learn it in order to git (haha) on the same page as everyone else. On most Linux distros this is included in command line. On Mac and Windows you can download git. When "Adjusting your PATH environment," I recommend selecting "Use Git from Git Bash" and not using git in the Windows Command Prompt. When "Configuring the line ending conversions" please use the settings recommended for your operating system.

{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.

Initial Setup

In order to get the PCBs onto your computer, use -+git clone <repo> <nowiki>--</nowiki>recursive <repo>+-. 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, follow the instructions to set up ((KiCAD)). Once this is done, you should be able to open the latest manufactured PCBs.

To open a PCB that is being designed, checkout the branch using -+git checkout <branch> --recurse-submodules+-. If you forget the submodule option, use -+git submodule update+- to get the correct libraries.

Starting a project

  1. Create and checkout a branch for your project in both the PCB and Libraries repositories
  • * -+git checkout -b <branch>+-
  1. Copy the latest template from the -+Dev+- folder
  2. Rename your file structure to follow the ((Standards|Storage Conventions))
  3. Make an initial commit to the Libraries and PCB repositories (in that order) as below
  • *For the first push use -+git push --set-upstream origin <branch>+- to create the branch on GitHub

Making changes

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

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

Editing libraries requires a different process, but it's the same whether editing just the Libraries or the Libraries and the PCB files.

  1. Edit the libraries and PCB files
  2. Ensure your working directory is the -+Libraries+- directory. This is to ensure changes are being made to the library repository, instead of the PCB repository.
  3. Stage( -+git add+- ), commit( -+git commit+- ), and push( -+git push+- ) the changes as described above.
  4. Change your working directory to the PCB repo
  5. Stage your changes. Make sure -+Libraries+- is included or the changes in the libraries will not update on GitHub.
  6. Commit and push as above.

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

  1. Pull the changes to the PCB files with -+git pull --recurse-submodules+-
  2. If you forgot to add -+<nowiki>--</nowiki>recurse-submodules+-, use -+git submodule update --init+-.

Finishing

TODO

Push your changes

Make a pull request

Create a tag

When you have (nearly) finished a project, you will create a pull request for your branch. You are forbidden from pulling your branch's changes into master all by yourself, in case something gets messed up.

  1. Go to the PCB repository on the GitHub website
  2. Click on the drop down menu "Branch: master" and click on your branch name
  3. Click "New Pull Request" in the button next to the drop down menu
  4. Add some sort of comment if you want, than click the green button that says "Create pull request"
  5. On the next page you may see
  • *"Review required": you should request a review from someone by clicking "Reviewers" on the right side and finding their username (James is roryee, be sure to bug him)
  • *"Merging is blocked" "merging can be performed automatically...": great, actually! You didn't mess with too much and there are no conflicts
  • *something something cannot be performed automatically, or merge conflict(s): uh oh. you should check out the diffs (under the "Files changed" tab near the top) and see what you can do about it
  1. After someone reviews and approves your pull request, you may get an email or notification
  • *it's nice when they tell it to merge for you
  • *if they don't, you have to go back to the page and do it
  • Special for admins: yes you can bypass checks and merge if you want. Use your power wisely.

/////

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

{TABS}