Can't understand how gitignore ignores the folders

后端 未结 3 944
轻奢々
轻奢々 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:45

    According to the documentation:

    "It is not possible to re-include a file if a parent directory of that file is excluded."

    For example, if you had already been working with the repository and told Git to ignore the parent directory, made some commits, and then went back and tried to allow some sub-directory of the excluded directory, it will not include that sub directory even if your .gitignore file is correct. To get around this, you need to force add it (with the -f flag):

    git add -f {file}
    

    Once this has been done, subsequent changes will be tracked.

提交回复
热议问题