Adding git submodule for arduino

How to add a git submodule to an arduino project

1. create a src folder in the same directory as the .ino file (link)

2. add the repo as a submodule

git submodule add <url>

3. commit and push changes to repo