Hi,
I am wondering what happens when you develop code on one machine and push it to github and then clone it down to another machine.
Won't vscode contains wrong paths to tools?
Vscode and github
Re: Vscode and github
I had the same thoughts when I first started programming using vscode/c/espressif (complete newbie).
For the tools themselves, you don't actually refer to them by location... following the "getting started" you clone the esp-isd then install.sh and then run the export.sh every subsequent time you wish to use it.
For vscode, it will find where you have installed the esp-idf and remember that. So where it physically resides doesn't matter (but for ease of use might as well clone and install to the same locations). If user names are different at least make sure the non-unique locations are the same (so on linux that would be everything after /home/your_user/ should ideally be the same).
vscode and the esp-idf "export.sh" set up some system variables ($IDF_PATH, etc.) so you don't need to worry about the location as the environment will always refer to those to get base locations.
In general don't save anything that is outside the code its self. Admittedly this makes it a bit annoying when doing initial clones (because you have to go in and manually add vscode settings at the project/folder levels), but with a good git ignore file subsequent syncs will just ignore those once they are set up.
For things such as projects/components referring to other projects/components that you're working on via yamls using local file paths, just make sure you clone everything to the same relative locations for each machine. For things that refer to other git project "components" or espressif component registry those will be downloaded on the fly so you don't need to worry about them (and the git ignore makes sure they don't get included). For local file paths use relative's before actual names; don't hard code the full folder structure.
The esp-idf uses some "must be named this way" structures (such as components must live within a component/ directory) so as you're partially constrained, might as well use identical setups anyways. I'm not sure how different os's might complicate things (linux & windows & mac).
This is my git ignore (at the user level: /home/user/.gitignore)
I've found the above, so far, makes sure my espressif projects only commit code and not settings and other "stuff".
I've seen some github projects that include the .vscode folders and/or other settings but I've never seen the point because there are additional levels of vscode settings that exist outside of project directories such as the user, profile, and workspace levels and as each level builds upon the others only saving only part of the structure seems incomplete at best.
Hopefully this gives you a few things to consider.
For the tools themselves, you don't actually refer to them by location... following the "getting started" you clone the esp-isd then install.sh and then run the export.sh every subsequent time you wish to use it.
For vscode, it will find where you have installed the esp-idf and remember that. So where it physically resides doesn't matter (but for ease of use might as well clone and install to the same locations). If user names are different at least make sure the non-unique locations are the same (so on linux that would be everything after /home/your_user/ should ideally be the same).
vscode and the esp-idf "export.sh" set up some system variables ($IDF_PATH, etc.) so you don't need to worry about the location as the environment will always refer to those to get base locations.
In general don't save anything that is outside the code its self. Admittedly this makes it a bit annoying when doing initial clones (because you have to go in and manually add vscode settings at the project/folder levels), but with a good git ignore file subsequent syncs will just ignore those once they are set up.
For things such as projects/components referring to other projects/components that you're working on via yamls using local file paths, just make sure you clone everything to the same relative locations for each machine. For things that refer to other git project "components" or espressif component registry those will be downloaded on the fly so you don't need to worry about them (and the git ignore makes sure they don't get included). For local file paths use relative's before actual names; don't hard code the full folder structure.
The esp-idf uses some "must be named this way" structures (such as components must live within a component/ directory) so as you're partially constrained, might as well use identical setups anyways. I'm not sure how different os's might complicate things (linux & windows & mac).
This is my git ignore (at the user level: /home/user/.gitignore)
Code: Select all
.idea/
__pycache__
.pytest_cache/
__installed_packages
[Bb]uild/
_build/
_static/
sdkconfig*
!sdkconfig.defaults
managed_components/
examples/components/
dependencies.lock
.vscode
*.code-workspace
debug.log
*.gdb
.editorconfig
dist/
I've seen some github projects that include the .vscode folders and/or other settings but I've never seen the point because there are additional levels of vscode settings that exist outside of project directories such as the user, profile, and workspace levels and as each level builds upon the others only saving only part of the structure seems incomplete at best.
Hopefully this gives you a few things to consider.
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot], ChatGPT-User, PetalBot and 2 guests