简体   繁体   English

如何让Composer导入现有(git)文件夹的工作副本?

[英]How to let Composer import working copy of existing (git) folder?

I've got a couple git projects and currently I'm working in two at the same time. 我有几个git项目,目前我同时从事两个项目。 I now want to import one of project into the other using composer. 现在,我想使用composer将一个项目导入另一个项目。 I try to do this using the following lines in my composer.json file: 我尝试在composer.json文件中使用以下几行来做到这一点:

"repositories": [
    {
        "type": "vcs",
        "url": "../otherproject"
    },
    {
        "type": "composer",
        "url": "http://our.local.stuff.com"
    }
],

This does seem to import the project, but only from the latest commit in that git repo. 这似乎确实导入了项目,但仅来自该git repo中的最新提交。 Instead, I would like it to import the existing files how they are, so that I don't have to commit for every little change I do in that project. 相反,我希望它以现有的方式导入现有文件,这样我就不必为在该项目中所做的每一个小更改都提交。

Does anybody know how this would be possible? 有人知道这怎么可能吗? All tips are welcome! 欢迎所有提示!

Composer will clone the remote repository, and you can actually work inside that folder with that Git repository just like when it is located anywhere else. Composer将克隆远程存储库,您实际上可以在该文件夹中使用该Git存储库,就像它位于其他任何位置一样。

Saving changes to files will make them effective immediately. 将更改保存到文件将使它们立即生效。 Adding and committing them will persist them in the repo locally. 添加并提交它们会将它们持久保存在本地存储库中。 Pushing a branch makes the changes available to others. 推送分支使更改可供其他人使用。

The only thing you should be aware of is that using any Composer command might destroy any uncommitted changes. 您唯一应该知道的是,使用任何Composer命令都可能会破坏所有未提交的更改。 So be careful when installing or even updating when you have uncommitted changes. 因此,当您进行未提交的更改时,甚至在安装或更新时都应小心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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