5

I'm creating a package but I would like to keep it private so only members of my dev team can use it.

I've checked this out on Google and Satis came back as an option.

I was just wondering do I need to use Satis to keep my package private or is there another way? Would a private repo on Git hub do the job?

panthro
  • 22,779
  • 66
  • 183
  • 324

1 Answers1

10

Yes you can use a Github private repo. I assume your intention is to use this package via composer. Simply add the below code to your composer file and replace the key values with your vendor/package name and the URL to the repository.

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

Here is the reference to the composer documentation on private repos:

https://getcomposer.org/doc/05-repositories.md#vcs

Tom
  • 602
  • 5
  • 20
  • Thanks, will my package remain private though once published? I do not wish for people outside the dev team to use it? – panthro Jun 24 '14 at 14:20
  • What do you mean by publishing your private repo? – Tom Jun 24 '14 at 23:11
  • If it's private it must not be published in packagist.org – Alex P Jul 22 '14 at 10:45
  • 2
    @drealecs: What the repositories key does is to point directly to GitHub instead of Packagist. Therefore, you don't have to publish to Packagist just get it to the private repo in GitHub, which will clone it. That's what Packagist is doing under the hood, and a couple other things I'm sure but unaware of. – Josh Bruce Jan 13 '19 at 18:09