How to modify the package root or exclude folder in composer?

Source: Internet
Author: User
I am now a GitHub repo folder structure is this:

foo/bar/abc/   composer.json   lib/   test/

I want to publish the ABC library on the packagist, but it seems like I can only publish the whole repo all at once. And,, and foo bar test so on are useless folders. How do I set ABC to the root directory at the time of publication and exclude Test?

There is also a premise that these folders are found in Git repo, but it is best not to appear on packagist.

Reply content:

I am now a GitHub repo folder structure is this:

foo/bar/abc/   composer.json   lib/   test/

I want to publish the ABC library on the packagist, but it seems like I can only publish the whole repo all at once. And,, and foo bar test so on are useless folders. How do I set ABC to the root directory at the time of publication and exclude Test?

There is also a premise that these folders are found in Git repo, but it is best not to appear on packagist.

How do I feel this should not be about composer, it's Git's problem? Just use it .gitignore to get rid of the relevant folder before submitting it.

Use git filter-branch or git subtree split command to cut out the ABC directory and submit it separately as a repo

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.