简体   繁体   中英

How to add files to main repository when using composer?

In my PHP project I use composer. For some reasons (stupid, but it's not depending on me) I must store all project files in a git repository, including "vendor/" files fetched by composer. I've removed "vendor/" from the .gitignore file, but some modules (like https://github.com/RWOverdijk/AssetManager ) are treated as submodules - and they are not being added to the repository ( git add ignores them).

What do I need to do, to force addition?

You can use the following commands:

# remove `.git` folders recursively
find vendor -type d -name '.git' -exec rm -rf {} \;
# Add the vendor folder
git add vendor

Probably it would be better to persuade your boss that composer isn't meant to work like that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM