Can't understand how gitignore ignores the folders

后端 未结 3 954
轻奢々
轻奢々 2020-12-16 00:29

I want to create repository for my Magento project. There are lots of folders and files in root directory and I change time to time only one folder: app/code/local/

3条回答
  •  误落风尘
    2020-12-16 00:38

    Try below to ignore like you need:

    /*
    !/app/
    /app/*
    !/app/code/
    /app/code/*
    !/app/code/local/
    

    The following discussion was helpful: http://git.661346.n2.nabble.com/negated-list-in-gitignore-no-fun-td1675067.html , especially the following from Linus:

    That's by design. You've chosen to ignore those directories; they match "*" themselves. Thus, 'git add .' doesn't descend into them looking for files.

    So basically, for each level you have to go in, unignore that folder, and ignore contents within that folder.

提交回复
热议问题