cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with creating GIT repository under STMCube IDE

JimEno
Associate III

I am using STMCube IDE and I fetched STM example project Lw_TCP_Echo_Server to be loaded into my STM Evaluation board Nucleo-H7S3L8. With some effort, I got it working. I want to use this project as a code base for my actual Ethernet project.

I want to archive this original, unmodified, intact, as is project into a git repository (not on GitHub yet). I want the repository to look exactly like the current project in my workspace (all files and folders intact). I cannot seem to do this. The example is a nested project and all attempts to commit have resulted in lost files and butchering the file folder structure. I end up with two visible projects in the Project Explorer (one in my workspace and one in my git repo) and neither one builds. I have tried  'team share projects', 'project copy paste', 'create from existing IOC', and anything else ChatGPT has suggested with no success. 

I want to do this under STMCube IDE not on the command line. STMCube does not seem to recognize/capture all the files and folders needed to create and commit the project to a git repository. If I need to split the nested project into its component projects, I guess I could be happy with that. I have not been able to find any forum posts on this very basic operation. I can't move forward with development without being able to preserve my work product.

Help would be appreciated.

11 REPLIES 11
Ghofrane GSOURI
ST Employee

Hello @JimEno 

Could you please specify which Git extension or plugin you are using from the STM32CubeIDE Marketplace?

GhofraneGSOURI_0-1761732747710.png

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

JimEno
Associate III

Ghofrane,

The 'About' tab reports:   Eclipse EGit Git integration for Eclipse 5.3.0.201903130848-r org.eclipse.egit

JimEno

Hello @JimEno 

The only EGit option available in the marketplace for STM32CubeIDE 1.19.0 is EGit Git integration for Eclipse 6.7.0. It appears that you are currently using a much older version. Upgrading both STM32CubeIDE to version 1.19.0 and EGit to version 6.7.0 via the Eclipse Marketplace is strongly recommended, as this will provide better compatibility, improved features, and a more reliable Git experience.

GhofraneGSOURI_0-1761740236500.png

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

JimEno
Associate III

I already have STM32CubeIDE 1.19.0 installed. I tried to install EGit Git integration for Eclipse 6.7.0 and it replied, 'cannot complete operation'. It also deleted my older version which left me with no GIT awareness at all. I reinstalled my older EGit 5.3.0 but my existing projects (which I managed to commit somehow) can't access GIT and I've lost all my history. So, thanks for the strong recommendation. Any ideas on how to restore my GIT connection?


@JimEno wrote:

I want to archive this original, unmodified, intact, as is project into a git repository (not on GitHub yet). I want the repository to look exactly like the current project in my workspace (all files and folders intact). 


You shouldn't want that. That's not how git is designed. You should not commit build artifacts and local user specific  settings. Also it is recommended to use the default line ending replacement(commit unix line endings). The trick is adding the right files in .gitignore. A fresh (recursive) clone should result in a correct build and a build should not result in a change in the git repo. That's the goal. I can help you set up a .gitignore.

If that's not your goal, then git is not designed for your purpose. Simply use zip files or some kind of archive format that supports incremental backup. 

 


@JimEno wrote:

The example is a nested project and all attempts to commit have resulted in lost files and butchering the file folder structure. 

Can you give an example of this nested project structure?
Perhaps using submodules would make your life easier. We use submodules at our company all the time.

 


@JimEno wrote:

I want to do this under STMCube IDE not on the command line.


I have used the git plugin for STM32CubeIDE in the past. I don't recommend it.
If you don't want to use the command line you can use git-gui or git of vscode.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
JimEno
Associate III

I think I'm chasing 2 problems:

I don't think my reinstallation of EGit Git integration for Eclipse 5.3.0 was successful.

I'm now using a very simple STM example project GPIO_IOToggle for my Nucleo-U5A5ZJ dev board. I fetched it into a clean empty workspace and it builds fine. When I right click on project\Team\Share Project... and fill in the fields, things fail (see below). The repo git repo was created, but the .git file is missing.

The second problem is that the project doesn't build anymore. I get errors and warnings. This happened even before my EGit fiasco, so I don't think that's what caused it.

So basically:

1) The Team\Share Project operation breaks the build operation

2) The Team\Share Project operation does not create proper git structure

 

JimEno_0-1761926044798.png

 

JimEno_1-1761926297055.png

JimEno_3-1761926638875.png

 

 

Pavel A.
Super User

For best results with git, recommend to use a standalone git application instead of any eclipse add-on. Many of these exist, including the GitHub's one. Installing arbitrary stuff into CubeIDE can break it and leave you in not-supportable state.

 

 


@JimEno wrote:

The repo git repo was created, but the .git file is missing.

 

JimEno_0-1761926044798.png

 


There's your problem. There is no such thing as a .git file. It's not a file it's a folder. Your repo is the root folder that contains the .git folder. It cannot find the .git folder inside the .git folder. So remove .git from the path in the repository field.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
JimEno
Associate III

unsigned_char_array,

Fine, it's a folder. I can't remove .git from the path, it's grayed out. I retried fresh with all my folders deleted. The 'team\share project' operation seemed to work (see below). So my #2 problem is fixed.

JimEno_1-1762183985332.png

 

That leaves my #1 problem - can't build after sharing project. I get the following (see below). I find Pavel A's response disturbing - 'Installing arbitrary stuff into CubeIDE can break it and leave you in not-supportable state'. I hardly consider a GIT Archive facility to be 'arbitrary stuff'.

Description Resource Path Location Type
make: *** No rule to make target 'C:/Users/JamesEno/git/GPIO_IOToggle_repo/Drivers/STM32U5xx_HAL_Driver/Src/stm32u5xx_hal.c', needed by 'Drivers/STM32U5xx_HAL_Driver/stm32u5xx_hal.o'. Stop. GPIO_IOToggle C/C++ Problem