Skip to main content
EPala.2
Associate III
Jan 5, 2024 5:06 PM UTC
Question

Standard GitIgnore / Project Setup for Sharing STM32Cube Projects with Github

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?

    13 replies

    InsignificantBit
    ST Employee
    Jan 5, 2024 5:21 PM UTC

    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
    Jan 9, 2024 6:54 PM UTC

    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
    Jan 16, 2024 6:36 PM UTC

    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
    Mar 21, 2024 10:49 AM UTC

    Add this to the .gitignore file

    # STM32CubeIDE
    .metadata/
    .settings/
    *.ld

    tdecker2
    Associate II
    Sep 12, 2024 7:07 AM UTC

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

    Explorer
    Sep 12, 2024 10:27 AM UTC

    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
    Sep 13, 2024 1:28 PM UTC

    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
    Mar 31, 2025 12:19 PM UTC

    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
    Aug 15, 2025 10:15 AM UTC

    Thank you, this helped me a lot.

    ATret.3
    Associate II
    Nov 28, 2025 9:35 PM UTC

    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.

    Associate
    Jun 19, 2026 12:58 PM UTC
    unsigned_char_array
    Lead III
    Jun 20, 2026 8:57 PM UTC

    I disagree with that gitignore.
    It ignores generated files. Meaning you cannot clone and then build without using TouchGFX Designer to generate them again. Makes CI builds much more difficult.
    It doesn’t ignore unused TouchGFX libraries for different MCUs.

    "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."