Skip to main content
Associate II
June 5, 2024
Solved

STM32CubeIDE - Prebuild command - Git error

  • June 5, 2024
  • 1 reply
  • 3653 views

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

 

 

 

    This topic has been closed for replies.
    Best answer by Scott_DeltaDev

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

    1 reply

    Scott_DeltaDevAuthorBest answer
    Associate II
    June 6, 2024

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