Skip to main content
EPala.2
Associate III
January 5, 2024
Question

Standard GitIgnore / Project Setup for Sharing STM32Cube Projects with Github

  • January 5, 2024
  • 5 replies
  • 13176 views

Hi, my team works with STM32CubeIDE and shares projects via github. We've been running into somewhat frequent errors where projects settings don't get shared properly when pulling the files down from github. On the flipside, there are a bunch of automatically generated files that change frequently with builds, code generation, etc, that bloat the git log unnecessarily if they are shared.

Is there a standard gitignore that we should be using for STM32CubeIDE projects. Are there any rules of thumb for how to set up stuff like project folder structure, project variables, etc, such that they get properly shared?

    5 replies

    InsignificantBit
    ST Employee
    January 5, 2024

    Other than your .cproject, .project, .ioc (if used) and linker file, and obviously the actual project source code, nothing else needs to be version-managed.

    Depending on the use case, you can find it convenient to version-control .launch configurations (mainly debugger settings) or project .settings (which contain things like SFR viewer favorites settings), but those are often specific for a single developer.

    EPala.2
    EPala.2Author
    Associate III
    January 9, 2024

    Thanks. Is there a standard gitignore file for STM32 projects you can share with us? There are a lot of autogenerated file types and it would be much easier to get a comprehensive list straight from the source than to try and account for each filetype manually by browsing through the project 

    EPala.2
    EPala.2Author
    Associate III
    January 16, 2024

    Hey just following up on this again. 

    If there is no official gitignore published by ST, does anyone have one they've used in development that has worked for them?

    Explorer
    March 21, 2024

    Add this to the .gitignore file

    # STM32CubeIDE
    .metadata/
    .settings/
    *.ld

    tdecker2
    Associate II
    September 12, 2024

    Why are the .ld files on your list? Do you always use the default generated linker file and never add custom sections?

    Explorer
    September 12, 2024

    Yes - I used the default linker file - so it's probably a good idea to remove the "*.ld" from .gitignore file. Sorry about that.

    InsignificantBit
    ST Employee
    September 13, 2024

    The linker file is definitely necessary. It gets generated only during the project creation by CubeMX (whether standalone or built into CubeIDE). If you remove it, it doesn't regenerate it upon building the project, it just throws an error about not being able to find it.

    Graduate II
    March 31, 2025

    Hi, I found a web page about github setting for STM32CubeIDE projects, and .gitignore example. I think it's not bad.

    https://tavotech.com/how-to-use-github-with-stm32cubeide/

    Explorer
    August 15, 2025

    Thank you, this helped me a lot.

    ATret.3
    Associate II
    November 28, 2025

    I am struck by ST's persistent disregard for this issue. Young developers are starting to work with STM32 MCUs and do not see adequate support from ST in terms of version control. This leads to bad habits... and rejection of the ST ecosystem.