How do you get git to ignore all contents of a directory?

后端 未结 3 1468
梦谈多话
梦谈多话 2020-12-13 06:11

I have a git directory which contains the a whole bunch of files and then has a directory called \'sessions\'. \'sessions\' contains cookie information for my web.py program

3条回答
  •  醉酒成梦
    2020-12-13 06:22

    Add a sessions/.gitignore file with

    *
    !.gitignore
    

    The second line tells git not to ignore the .gitignore file, so the folder is not empty but everything else is ignored.

提交回复
热议问题