2024-10-14 03:29 AM
Hi all,
I have a project that has been developed within STM32CubeIDE. I also have a github repository associated with the project. What I now want to do is branch the project to work on some other features. I may want to have two separate projects in the future, one with the original features and one with the new features. I may also want to simply merge the branch at a later date and have only the project with the new features added. How can I do this while working within STM32CubeIDE? Obviously CubeIDE doesn't know that I've started a new branch, so any changes I make will be made to the same project within CubeIDE. Do I need to make a separate project within CubeIDE? How can I associate that with the new branch? I could simply copy the project within CubeIDE and make a new repository for the new project, but I'd like to keep everything within the same repository and just branch - the git intended. Any help with this would be great.
2024-10-14 07:24 AM
You can use git in STMCubeIDE, It's eclipse based and all plugin will work normally.
2024-10-14 07:43 AM
I dont know if it is the best solution but this is what I do:
A: include project files in Git repository
B: include the workspace in the Git repository or better: as 2nd git repository (you may bind it as subproject if you like or manage by hand...
C: when change branches close the IDE, commit project & workspace, switch branch, reopen the IDE
This ensures things are consistent. Of course if you add files or change project settings you need to copy these changes to all branches as needed.
PS: I use external git Gui tools and a bunch of scripts - not the eclipse plugin
2024-10-14 07:52 AM
Option B is NOT recomended by eclipse.
PS git repositories should be outside od workingspace.
2024-10-14 08:23 AM
You can either use a plugin in STM32CubeIDE by searching in the Eclipse Marketplace under the Help menu, or you can use a 3rd party Git interface. I like using TortoiseGit which you can use on other types of folders that are not an STM32 project. It has a lot of features
2024-10-14 10:08 AM
Well, I have encountered a screwed up workspace with eclipse / stm32cubeide several times now, and the best solution to fix it and get a working setup again was to include the workspace in the version control. Its not elegant, but at least it mitigates the problem.
but I recommand to put it in a own repository as it has anonther commit frequency as the normal project.
2024-10-14 10:09 AM
after testing a lot Git Gui's I can recommand gitkraken or gittyup as second best
2024-10-14 10:35 AM
Again, including workspace in git repo i very bad idea,
Eclipse (STMCubeIDE) have very good GUI for git, many people seys the best, and use quite often eclipse only for git.
2024-10-14 01:46 PM
To make it clear, you can create a repository for each project. And each repository can be part of the Eclipse workspace. You can clone/branch individual projects.
However, if you make the Eclipse workspace a repository, when you want to clone only one project, you have no option but to clone all the projects from inside the workspace.
2024-10-15 12:41 AM
I think my understanding of how the IDE and Git interact (or don't) was a bit flawed. I can branch the project off within Git, do my changes within the IDE and then if I want to go back to the master project I can just do that in Git and then reload the IDE. I was getting stuck on the idea of having two separate projects to work from within the IDE, which I guess isn't really the point?