Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have the following in my Laravel 5.1 projects composer.json to add a public github repository as a dependency.

...    
"repositories": [
  {
    "type": "package",
    "package": {
      "name": "myVendorName/my_private_repo",
      "version": "1.2.3",
      "source": {
        "type" : "git",
        "url" : "git://github.com/myVendorName/my_private_repo.git",
        "reference" : "master"
      },
      "dist": {
        "url": "https://github.com/myVendorName/my_private_repo/archive/master.zip",
        "type": "zip"
      }
    }
  }
],
"require": {
     ....
    "myVendorName/my_private_repo": "*",
},
...

This works as long as the repository is public. Now I've set this repository to private. The git credentials I use for pulling/pushing to 'my_private_repo' are the one of a colaborator of the project. How can I achieve that composer pulls from that private repository when I run composer update or composer install?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
337 views
Welcome To Ask or Share your Answers For Others

1 Answer

Work with private repositories at GitHub and BitBucket:

JSON

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

The only requirement is the installation of SSH keys for a git client.

Docs


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...