编译器模块,它是git修改的,但它不是在git上上演


composer module it is git modified but it is not staged on git

我已经开始使用composer的新项目。项目使用git进行版本跟踪。

事情是,我已经安装了组件"zendframework/zend-session": "^2.7",现在当我尝试执行git add vendor/zendframework/zend-session,然后我运行git status,我得到以下结果:

On branch feature/install-session-manager
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)
        modified:   vendor/zendframework/zend-session (modified content)
no changes added to commit (use "git add" and/or "git commit -a")

注意:当然,我没有修改文件夹vendor/zendframework/zend-session

中的文件代码

有没有人知道我如何才能最终在我的git存储库上进行此修改?

您需要-这是一个很好的做法-将vendor文件夹添加到.gitignore

这样每个开发人员都可以有不同的本地版本的供应商,你不需要将它们存储/检索到你的git repo

要将其添加到.gitignore,只需将字符串vendor放入文件

要取消跟踪现在在.gitignore下的以前的文件,只需运行

git rm -r --cached .