Is the .git directory which is created in new nRF Connect projects important or can it be deleted?

Hi, when I create a new project in the nRF Connect plugin for VS Code (based on a sample, e.g. zephyr/samples/basic/threads), there is a directory called ".git" created in the project directory.

Is this .git directory necessary for the project itself (for the toolchain or build operations)? Or can we just delete it? We use a different versioning system. I just want to make sure that everything will still work in the future if I remove this directory (and don't commit it to our versioning system).

Best regards,

Michael

Parents Reply Children
  • Hello Kenneth,

    I know what git is, although I prefer Mercurial ;) And in our current project, we are using SVN.

    So, is the .git folder just a local repository intended for the developer to track his own work? Then we don't need it, as it can also be done in our SVN.

    Could you also confirm that NCS release updates will work reliably without the .git directory?

    Best regards,

    Michael

  • I am just a user of git, and use is to switch mostly between tagged releases when compiling and looking for examples, I would suspect this will not work if you delete the git folder. The west yaml file contain the git repositories and revision that is used for a specific tagged release:
    https://github.com/nrfconnect/sdk-nrf/blob/main/west.yml

    Kenneth

  • This is getting even more confusing...

    I just hope that I won't be forced to use git if I want to compile my nRF project and create a software release.

  • If you delete the .git folder then you will no longer be able to use git commands to diff and swap between nrf connect sdk releases. In other words you will be stuck on a specific nrf connect sdk release, you will be able to build and compile any project within that release, however if we release for instance a  bug fix on one of our repositories I don't understand how you will be able to get that bug fix if you have deleted your .git folder.

    Kenneth

  • I supposed all the SDK related stuff is checked out into the c:\ncs\... directory, I never talked about touching the .git directoreis there. Shouldn't they be enough for updating and swapping the SDK, as they are in the same place where the SDK itself is checked out?

    My question was about the .git folder created in my own project direcory if I start a new project from within VIsual Studio Code. Although I don't know if this repository is linked to the .git repositories in the c:\ncs\... directory... shouldn't the reference to the currently used SDK be stored in the project file and not in the .git directory?

    Sorry for the long discussion, maybe we are talking at cross-purposes.

    Best regards,

    Michael

Related