0

My project is based on another "core" project i've built.

I'm currently adding this "core" project to my project using git subtree command.

Is there a way that I can add the project as a dependency ? Can I add it as a (private) package ?

3
  • I'm not sure what are you trying to accomplish. Using your local git repository as dependency for another local git repository? Could you provide your current composer.json? Commented Jun 22, 2015 at 12:46
  • Simple answer: Yes! I think a good answer depends on some more information. Where is your core project hosted? Is it local or in a git repo or at github? Does your project already make use of composer? Is it a problem if your core project is within a /vendor/ folder inside your current project? Commented Jun 22, 2015 at 12:50
  • @Peh Yes, to project is hosted in a remote repo (bitbucket) and has its own composer. I currently use git subtree since it allow me to change the core project from the current project but it can be the same in the vendor as well (i think at least) Commented Jun 22, 2015 at 13:08

1 Answer 1

1

If your core project already has a composer.json you can require it form any other project.

Here is an example for requiring from a bitbucket repo:

{
    "require": {
        "vendor/my-private-repo": "dev-master"
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "[email protected]:vendor/my-private-repo.git"
        }
    ]
}

For more see the composer docs at using private repositories

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.