PlatformIO Community

Version control and library development


I’m working on my main code and I’ve need to modify someone else’s libraries.
So I forked a copy and I include that in my platformio.ini.

    lib_deps =
  # Using a library name

So I make the changes but under the source control tab I only see pending changes to my main program. Nothing about the library in .piolibdeps which I modified.

As you can tell I’m kinda newbie at this.
Am I going about this the wrong way?
Do I need to check it out via command line to a different folder and then specify that include folder? And then am I going to be forced to used the command line to make my commits?

I really like the visual notifications of changes vs stock…




Does VSCode show you the modifications to the library when you have opened one of its source files? What does git branch -a show in the library folders?

Btw because of the .gitignore containing .piolibdeps, git will not push the contents of that library into the repository of your main firmware.


No… VSCode doesn’t show the mods. Only my main code shows the mods.
git branch shows no branch

I’m guessing that it just downloads the code vs doing a checkout? I see the gitignore.
So do I have to manually checkout the library in a separate folder?
I can’t be the first one to do library development as well as main program development at the same time! :slight_smile:


You’re executing this inside the folder of your modded library, right? Which is where? What’s the full output?


It’s in the .piolibdeps/mylibrary folder
The output is
* (no branch)

If I go up one to the .piolibdeps folder and do it I get

* master
  remotes/origin/HEAD -> origin/master


Can you delete your .pioenvs again and rebuild the project. Do you see some output about a git clone?


I deleted the .pioenvs folder. Recompile. Nothing at all about a git clone.
Nothing at all about git.
I do see a .git file in the .piolibdeps/mylibrary folder. And I can see differences when I do a tortise git diff on the two library files I changed. So I guess I can manually commit the changes. But it would be nice to see them in the editor. I wonder if I comment out the piolibdeps in the git ignore file… hmm…


That will make it push .piolibdeps in your main firmware’s repo, which you probably don’t want. I’ll try out what the correct way is myself.


Did you get a chance to figure out the correct way to do this?