我想为我的Magento项目创建存储库.根目录中有很多文件夹和文件,我只更改一个文件夹的时间:app/code/local /
我想忽略的其他一切.但是......不能.我的.gitignore文件:
*
!app/code/local/
!app/code/local/*
Run Code Online (Sandbox Code Playgroud)
然后,当我尝试将文件夹添加到repo时,我收到一个错误:
git add app/code/local/Mds/
The following paths are ignored by one of your .gitignore files:
app
Use -f if you really want to add them.
fatal: no files added
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮忙吗?
man*_*lds 17
请尝试以下内容,忽略您的需要:
/*
!/app/
/app/*
!/app/code/
/app/code/*
!/app/code/local/
Run Code Online (Sandbox Code Playgroud)
以下讨论很有帮助:http://git.661346.n2.nabble.com/negated-list-in-gitignore-no-fun-td1675067.html,特别是来自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.
所以基本上,对于你必须进入的每个级别,取消该文件夹的内容,并忽略该文件夹中的内容.