cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE - Prebuild command - Git error

Scott_DeltaDev
Associate II

STM32CubeIDE v1.15.1

Git v2.45.1.windows.1

Windows 11

 

The software project includes the pre-build command,

"git log --pretty=format:'%H' -n 1 > git_hash.h" (format string simplified for this post)

On a fresh install on a new PC the following error prevents building the project,

"fatal: bad object HEAD"

 

Building on other computers doesn't produce this error.  On this computer, git works from the command line, including copying the string from the pre-build settings into the Command Shell Console in STM32CubeIDE.  Running STM32CubeIDE as administrator doesn't change behavior.

The command 'where git' returns the same path in both cmd.exe and STM32CubeIDE console.  All git operations function normally from both the command line and a GUI tool (GitExtensions).

 

Thoughts on the source of the git error?

Could STM32CubeIDE be using a different git.exe than is mapped to 'git' in the system?

 

Thanks!

Scott_DeltaDev_1-1717628912723.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Scott_DeltaDev
Associate II

Update - STMCubeIDE v1.14.1 compiles the project a creates git_hash.h w/o errors

View solution in original post

1 REPLY 1
Scott_DeltaDev
Associate II

Update - STMCubeIDE v1.14.1 compiles the project a creates git_hash.h w/o errors