# Using Git for Arduino Project Documentation
This guide will help you get started with the basics of Git version control and documentation for your Arduino projects. Follow these simple steps to learn Git and begin documenting your own project.
# Step 1: Install Required Software
Install Git
- Download from git-scm.com and follow the installation instructions for your operating system
- For macOS, you can also use
brew install gitif you have Homebrew
Install VS Code
- Download Visual Studio Code from code.visualstudio.com
- This will be your text editor for code and documentation. Note that there are plugins that allow for Arduino development within VS Code. Skipping that in favour of the basics here.
Install the Arduino IDE
- Download from arduino.cc/en/software
- This is needed for Arduino development
# Step 2: Clone The Starting Repository
You can explore the starter github repository here.
Open your terminal or command prompt
Navigate to where you want to store the repository
Run this command to clone the repository:
git clone https://github.com/jtrudeau/arduinogitresource2025.gitMove into the cloned directory:
cd arduinogitresource2025
# Step 3: Explore the Repository
Open the repository in VS Code. From the terminal you can type:
code .Important Resources to Explore:
README.md: Overview of the repositoryEXERCISES.md: Optional practice exercises to learn Gittemplates/: Contains project templates and examplestemplates/MARKDOWN_GUIDE.md: Guide to formatting your documentationtemplates/ARDUINO_PROJECT_TEMPLATE.md: Template for Arduino project documentationtemplates/sample_project/: Rough example Arduino data logger projectexamples/: Sample files to reference
Complete a few exercises from
EXERCISES.mdto get familiar with Git commands
# Step 4: Start Your Own Project Repository
Once you're familiar with the basics, create your own repository for your Arduino project:
- Go to github.com and sign in.
- Click the "+" icon in the top right and select "New repository"
- Name your repository (e.g., "arduino-datalogger-project")
- Choose "Public" visibility
- Do NOT initialize with README, .gitignore, or license
- Click "Create repository"
- GitHub will show instructions for pushing an existing repository - you'll use these soon
# Step 5: Initialize Your Project
Create a new folder for your project:
mkdir my-arduino-project cd my-arduino-projectInitialize Git in this folder:
git initOpen the project in VS Code:
code .Start by creating a README.md file (use our template as a guide):
- Copy the content from
templates/ARDUINO_PROJECT_TEMPLATE.md - Save it as
README.mdin your new project
- Copy the content from
Create your first commit:
git add README.md git commit -m "Initial commit with README template"Connect your local repository to GitHub:
git remote add origin https://github.com/YOUR-USERNAME/arduino-datalogger-project.git(Replace YOUR-USERNAME with your GitHub username, and arduino-datalogger-project with your repository name)
Push your first commit to GitHub:
git push -u origin main
# Step 6: Document Your Arduino Project
Create a project structure:
images/: Folder for images and diagrams
Document your project using the templates:
- Update your README.md with your project information
- Add Arduino code
- Use markdown formatting from the Markdown Guide
- Take photos or create diagrams of your circuit and add them to the images/ folder
Commit your changes regularly:
git add . git commit -m "Add project documentation and code" git push
# Getting Help
If you get stuck:
- Ask for help
- Refer to the Git Cheat Sheet in this repository
- Check the GitHub documentation
- Look at the sample project for examples of good documentation
Remember: The goal is to document your Arduino project clearly so that others can understand and replicate your work.