Difference between revisions of "Using Git and GitHub"

From Elcano Project Wiki
Jump to navigation Jump to search
(Created page with "The Elcano repositories are on https://github.com/elcano There is a separate repository for each microprocessor: * LowLevel: Drive by wire * HighLevel: Localization, mapping a...")
 
Line 1: Line 1:
The Elcano repositories are on https://github.com/elcano
 
There is a separate repository for each microprocessor:
 
* LowLevel: Drive by wire
 
* HighLevel: Localization, mapping and path planning
 
* Transceiver: Remote control transmitter and receiver
 
* Sonar: Obstacle detection from ultra-sound
 
* Sweep: Obstacle detection by laser
 
* QDED: Raspberry Pi Vision based on quadrature disambiguation edge detection
 
* General: for items that are shared between processors.
 
 
In the past, all code was in the single repository Elcano/Elcano. That repository has been archived. Any useful files from it should be copied to the appropriate repository.
 
 
Working with Git
 
Working with Git
  

Revision as of 22:57, 9 October 2019

Working with Git

See the tutorial: https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners

Typically, you will start with an Elcano repository, and then fork it to your own repository. For instance, fork Elcano/Transceiver to Jane/Transceiver. Both of these repositories live in the cloud. You would then download Jane/Transceiver to your PC. You can do a lot of work in that repository on your PC. When you have code on your PC that has been tested, the next st ep is to upload it. Suppose that on your PC you have updated the file xmit/ RadioControl_rf69/ RadioControl_rf69.ino. You need to get into a bash shell window on your PC, and use cd to make xmit the current directory.

git status // should show nothing changed

git add RadioControl_rf69/ RadioControl_rf69.ino

git commit -m “Removed a delay statement that blocked while waiting for an ack”

Be sure to make your messages reflect what you did for this particular fix. Git supports small incremental changes, and make it possible to roll then back if needed. Please do not wait until the end of the quarter to dump all your changes into the main repository.

git push origin master

This command assumes that you have set origin to the URL for xmit and master to the URL for Jane/Transceiver. It puts your new code into your repository on the cloud.

The next stage is to make a pull request. You are asking to have your code made part of the official Elcano/Transceiver. You are not allowed to directly push to Elcano repositories. If your pull request is accepted, your code becomes part of the Elcano project. A pull request is made from a web browser on Elcano/Transceiver, or whatever repository you are working with.

Settings.h

This file is required by most processors, but is not kept in any repository. It is meant to include individual vehicle features. All the rest of the code should be written to be portable across a wide variety of vehicles. Specific attributes of a trike (such as wheel diameter, turning radius, etc.) should be kept in a settings.h file for that vehicle. The file SettingsTemplate.h is kept in the General repository. This file should be used to set up an individual setting.h file.