Using Git and GitHub

From Elcano Project Wiki
Revision as of 00:51, 10 October 2019 by Ptressel (talk | contribs) (Ptressel moved page GitUsage to Using Git and GitHub: The abbreviated name was showing up as the page title.)
Jump to navigation Jump to search

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.