How to track directories but not their files with Git?

前端 未结 5 2067
礼貌的吻别
礼貌的吻别 2020-12-02 10:22

I\'ve recently started using Git and am having trouble with just one thing. How can I track directories without tracking their contents?

For example the site I\'m wo

5条回答
  •  醉梦人生
    2020-12-02 11:04

    The best solution so far:

    1) Create a .gitignore file

    2) Write inside:

    *
    */
    !.gitignore
    

    3) Add the .gitignore file to the folder that you want.

    Source: https://stackoverflow.com/a/5581995/2958543

提交回复
热议问题