Composer 没有为包生成 .git 文件夹

Composer not generating .git folder for packages(Composer 没有为包生成 .git 文件夹)
本文介绍了Composer 没有为包生成 .git 文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这很奇怪,好像我错过了一些小东西.几天前,当我 composer install 时,我得到了带有自己的 .git 的 Vendor 目录,这使我可以进行更改并更新自己的打包存储库.

This is weird, seems like something small that I'm missing. A few days ago, when I composer install I get Vendor directories with their own .git, this allows me to make changes and update my own packaged repositories.

今天运行composer install后,每个包文件夹内的.git目录不见了!(我认为这可能与从缓存安装有关?)

Today, after running composer install, the .git directories inside each package folder is missing! (I think this might have something to do with installing from cache?)

有人可以尝试重新创建这个吗?

Could someone please try re-create this?

$ git clone https://github.com/nathankot/rbhpi
$ cd rbhpi
$ ./composer.phar install
$ cd vendor/rbhpi/core
$ ls -a

从上面的命令中,.git 目录对我来说是缺失的.

From the above commands, the .git directory is missing for me.

我在文档中找不到这个规范,但我确实在 这个常见问题项目:

I couldn't find this spec in the docs, but I did find it in this faq item:

安装后删除所有依赖的.git目录

Remove the .git directory of every dependency after the installation

我的问题有什么解决方案吗?

Any solutions to my problem?

推荐答案

Composer 更喜欢你的依赖项的 dist 包,这意味着从 github 下载 .tgz 并解压它.如果您想要源代码,请使用

Composer prefers the dist package of your dependencies, meaning dowloading a .tgz from github and unpacking it. If you want the source, install your vendors with

composer install --prefer-source

这会像你想要的那样做一个 git checkout.

This will do a git checkout like you want.

这篇关于Composer 没有为包生成 .git 文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Convert JSON integers and floats to strings(将JSON整数和浮点数转换为字符串)
in php how do I use preg replace to turn a url into a tinyurl(在php中,如何使用preg替换将URL转换为TinyURL)
all day appointment for ics calendar file wont work(ICS日历文件的全天约会不起作用)
trim function is giving unexpected values php(Trim函数提供了意外的值php)
Basic PDO connection to MySQL(到MySQL的基本PDO连接)
PHP number_format returns 1.00(Php number_Format返回1.00)