How can I add an empty directory to a Git repository?

后端 未结 30 2499
离开以前
离开以前 2020-11-21 04:52

How can I add an empty directory (that contains no files) to a Git repository?

30条回答
  •  遥遥无期
    2020-11-21 05:21

    An easy way to do this is by adding a .gitkeep file to the directory you wish to (currently) keep empty.

    See this SOF answer for further info - which also explains why some people find the competing convention of adding a .gitignore file (as stated in many answers here) confusing.

提交回复
热议问题