How to track directories but not their files with Git?

前端 未结 5 2077
礼貌的吻别
礼貌的吻别 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 10:58

    Best answerd I've found is to include a .gitignore file in your upload folder with this content

    # Ignore everything in this directory
    *
    # Except this file
    !.gitignore
    

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

提交回复
热议问题