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
  • 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

Children
  • 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

  • puz_md said:
    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?

    Thanks for the clarification, the .git folder can be deleted yes. The project is unaware of git.

    Kenneth

Related