Project Creation and `git` Help - team1868/1868wiki GitHub Wiki

Setup

Project Creation

This assumes you’ve followed the environment setup guide

  1. Use WPI lib project template or the robot builder tool to structure your project
  2. Add vendor dependencies (every season these should be updated so do not copy them from old projects)
  3. Add clang format file in the project's root directory
  4. Add pre-commit configuration file in the project's root directory
  5. Install pre-commit using pre-commit install
  6. (optional) Add workflows from previous projects .github directory for extra checks and repository configurations

Cloning an Existing Repository

  1. git clone <repo url>
  2. cd <repo directory>
  3. pre-commit install

Update a branch to match what's on github.com

  1. git checkout <branch name>
  2. git pull

Bring a branch up to date with main

  1. git fetch origin
  2. git checkout <branch name>
  3. git merge origin/main
  4. :wq -- to resolve the message that pops up

General

Tooling

  1. VScode
    1. Integrated developer environment (IDE) that integrates with WPILIB
  2. Clang format
    1. We use clang-format to auto format our code using a custom clang-format file. With the xaver.clang-format vscode plugin installed, use shift + option + f on mac and alt + shift + f on windows to auto-format the current file.
  3. Pre-commit
    1. Pre-commit forces your files to be formatted before committing them
  4. Photon vision
    1. 3’rd party vision library
  5. CTRE libraries (Phoenix)
  6. REV libraries
⚠️ **GitHub.com Fallback** ⚠️