Home > Backend Development > PHP Tutorial > 如何在Composer里修改package的根目录或排除文件夹?

如何在Composer里修改package的根目录或排除文件夹?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:44:09
Original
1251 people have browsed it

我现在一个github repo的文件夹结构是这样的:

<code>foo/
bar/
abc/
   composer.json
   lib/
   test/
</code>
Copy after login
Copy after login

我想把abc这个库在packagist上面发布,但是好像只能一下子把整个repo都发布。而foobartest等都是无用的文件夹。如何将abc设置成发布时的根目录,并且把test排除掉呢?


还有一个前提,就是这些文件夹得出现在git repo里,但是最好不要出现在packagist上面。

回复内容:

我现在一个github repo的文件夹结构是这样的:

<code>foo/
bar/
abc/
   composer.json
   lib/
   test/
</code>
Copy after login
Copy after login

我想把abc这个库在packagist上面发布,但是好像只能一下子把整个repo都发布。而foobartest等都是无用的文件夹。如何将abc设置成发布时的根目录,并且把test排除掉呢?


还有一个前提,就是这些文件夹得出现在git repo里,但是最好不要出现在packagist上面。

我怎么觉得这事情应该跟composer无关,是git的问题?直接用.gitignore在提交之前去除掉相关的文件夹不行么?

使用git filter-branch 或者 git subtree split 命令把abc目录切出来单独提交成一个repo

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
PHP study installation composer cannot be used
From 1970-01-01 08:00:00
0
0
0
php - Win10 composer installation problem
From 1970-01-01 08:00:00
0
0
0
php - Error using composer
From 1970-01-01 08:00:00
0
0
0
ThinkPHP Why use composer?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template