New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why composer clone my private gitlab instead only download it #6016

Closed
emimarz opened this Issue Dec 30, 2016 · 12 comments

Comments

Projects
None yet
7 participants
@emimarz

emimarz commented Dec 30, 2016

My composer.json:

{
     "config":{
         "preferred-install": "dist",
         "secure-http": false
     },
     "minimum-stability": "dev",
     "repositories": [ {
         "type": "git",
         "url": "http://gitlab.local/GROUPNAME/REPOSITORY.git"
     }],
     "require": {
         "GROUPNAME/REPOSITORY": "0.1.0"
     }
}

When I run this command:

 composer install -o --prefer-dist

I get the following output:

  - Installing GROUPNAME/REPOSITORY (0.1.0)
    Cloning 80ed35991668ad0df9f2857b6021c61c4c70c74b

And I expected this to happen:
this add a .git folder inside vendor/GROUPNAME/REPOSITORY but I don't want create that folder, I only want download my package like the others packages

@alcohol

This comment has been minimized.

Member

alcohol commented Dec 31, 2016

You might want to use vcs and not git type of repository.

@alcohol alcohol added the Support label Dec 31, 2016

@tobias-trozowski

This comment has been minimized.

tobias-trozowski commented Dec 31, 2016

@alcohol what is the difference? i thought they do the same... :O

@alcohol

This comment has been minimized.

Member

alcohol commented Jan 2, 2017

They are not the same.

git type is "dumb" and purely treats it as a git repository. So in order to retrieve any information such as branches and tags, it first does a local clone into cache directory.

vcs type is "smart" and will use the Github/Bitbucket/Gitlab API when possible to retrieve information about branches and/or tags.

@tobias-trozowski

This comment has been minimized.

tobias-trozowski commented Jan 2, 2017

Ah ok thx, just removed my way more complicated - and obviously wrong - answer.

@alcohol

This comment has been minimized.

Member

alcohol commented Jan 2, 2017

That was not necessary..

@emimarz

This comment has been minimized.

emimarz commented Jan 2, 2017

I tried both types
"type": "git",
"type": "vcs",

but I obtain the same result

@stof

This comment has been minimized.

Contributor

stof commented Jan 2, 2017

You need to configure your domain as being a gitlab domain if you want the gitlab API to be used (by default, only gitlab.com is registered there, as composer cannot know your private gitlab domain automatically): https://getcomposer.org/doc/06-config.md#gitlab-domains

@Seldaek Seldaek closed this Jan 22, 2017

@AndrewRadchenko

This comment has been minimized.

AndrewRadchenko commented Apr 5, 2017

@emimarz Same problem. Did anybody find the solution?

@pursehouse

This comment has been minimized.

pursehouse commented Apr 11, 2018

seems that the only fix is to set
"config" : { "preferred-install" : "source",
which is kinda weak that there doesn't seem to be any way to set the preferred on a repository specific level

@Seldaek

This comment has been minimized.

Member

Seldaek commented Apr 11, 2018

@pursehouse

This comment has been minimized.

pursehouse commented Apr 12, 2018

@Seldaek perfect! thanks! I assume that --prefer-dist from the cli will override all in there?

@Seldaek

This comment has been minimized.

Member

Seldaek commented Apr 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment