Skip to content

Instantly share code, notes, and snippets.

@anhphamt
Created November 7, 2016 03:43
Show Gist options
  • Save anhphamt/b31a1c9fbecea3a46de77f2deba1308a to your computer and use it in GitHub Desktop.
Save anhphamt/b31a1c9fbecea3a46de77f2deba1308a to your computer and use it in GitHub Desktop.
How to composer with a fork repository

** Add a Forked Repository to your project **

Sometimes you want to make some changes on original repository and add it to your project. Below is the way we require a forked repository. http://tech.osteel.me/posts/2015/08/10/how-to-use-the-fork-of-a-repository-with-composer.html

If I wanted to use a fork of Guzzle for example, I would edit composer.json like so (osteel is my GitHub username):

{  
    "name": "osteel/myproject",  
    "description": "My project.",  
    "license": "MIT",  
    "type": "project",  
    "repositories": [  
        {  
            "type": "vcs",  
            "url": "https://github.com/osteel/guzzle"  
        }  
    ],  
    "require": {  
        "laravel/lumen-framework": "5.1.*",  
        "guzzlehttp/guzzle": "dev-master"  
    }  
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment