Skip to content
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

clone from private repository #525

Closed
yangblink opened this issue Jul 13, 2017 · 18 comments
Closed

clone from private repository #525

yangblink opened this issue Jul 13, 2017 · 18 comments
Labels

Comments

@yangblink
Copy link

i use private gitlab, the vue-cli version is 2.8.2

if i clone with project-name like this

vue init -c gitlab.com:username/my-vue-template test

it show err:

vue-cli · Failed to download repo vuejs-templates/test: 'git clone' failed with status 128

it seems that the order of argument is wrong

use this cammnd is work fine

vue init -c test gitlab.com:username/my-vue-template 

and this

vue-init  gitlab.com:username/my-vue-template test
@posva
Copy link
Member

posva commented Jul 13, 2017

From readme:

If you would like to download from a private repository use the --clone flag and the cli will use git clone so your SSH keys are used.

@posva posva closed this as completed Jul 13, 2017
@yangblink
Copy link
Author

@posva thanks for quick prompt
I mean it's should

# yes
vue init --clone my-project username/repo   # it's right on my mac

# no 
vue init --clone username/repo my-project  # vue will treate `my-project` as the repository addr

or it's just the bug of my commander module

@posva posva reopened this Jul 13, 2017
@posva
Copy link
Member

posva commented Jul 13, 2017

I see the bug, I'll fix it

@posva posva added the bug label Jul 13, 2017
@posva
Copy link
Member

posva commented Jul 13, 2017

I gave it a look but I don't understand why the order is being messed up when loading the args. Can you take a quick look @egoist , please?

@posva
Copy link
Member

posva commented Jul 13, 2017

BTW, using the option at the end works as expected

@mrcsmcln
Copy link

Not sure if this helps, but this appears to work (just replace vue init with vue-init):

vue-init -c gitlab:user/repo my-project

@bajras
Copy link

bajras commented Jul 27, 2017

Im having a similar kind of issue with the custom template and its hosted in my work's private bitbucket repo and get the following error:

vue-cli · Failed to download repo ssh://[email protected]:7999/mac/vue-moo-webpack-boilerplate.git: 'git clone' failed with status 128

I tried all the mentioned steps:
vue init -c ssh://[email protected]:7999/mac/vue-moo-webpack-boilerplate.git yay
vue init ssh://[email protected]:7999/mac/vue-moo-webpack-boilerplate.git --clone yay

When I put in on a public Github repo it works fine but not sure why its not working with the private bitbucket repo?

When I do git clone bitbucket of the exact repo it works fine as so I can tell its not the connection issue with SSH.

git clone ssh://[email protected]:7999/mac/vue-moo-webpack-boilerplate.git

Any help would be highly appreciated. Thanks.

@mrcsmcln
Copy link

@bajras did you try replacing vue init with vue-init?

@bajras
Copy link

bajras commented Jul 27, 2017

@mrcsmcln yes, that didnt work either.

@winnieBear
Copy link

me too, In Window OS. I pull a request fix the bug.

#  in Windows OS
vue-init -c gitlab:gitlab.host:user/repo project-name

@lee-chase
Copy link

lee-chase commented Aug 16, 2017

commander appears to be switching the order of the args.

vue init a b

Program.args[0] === a
Program.args[1] === b

vue init -c a b

Program.args[0] === b
Program.args[1] === a

Perhaps an iterating through an object with no guarantee of order.

@lee-chase
Copy link

Running

vue init --clone a b

Causes Commander.prototype.parse to be run twice. First for 'vue' which results in '--clone a' being seen as an unknown parameter. The unknown parameters are then tacked back on in Commander.prototype.parseArgs.

Personally, I'd see this as a bug in Commander which could do better with named arguments. That said --clone is not a named argument, it is being used as a switch and Commander does not seem to support argumentless switches.

It is perhaps less confusing to suggest users use the following command

vue init --clone=true a b

@nodejser
Copy link

I pull a request fix the bug

# There will be errors in the windows
vue init gitlab:http://192.168.1.125:nodejser/templates my-project

@torsteinringnes
Copy link

@bajras Did u manage to solve this? Installing templates from your works private repo?

@adamkpurdy
Copy link

Has this been fixed on OSX? I see that it was closed on Aug 18th, and reopened for window's OS.

Unfortunately I can't get this to work either. I've tried all options mentioned in this thread.

@bajras
Copy link

bajras commented Nov 4, 2017

I have not been able to get it work. Had to clone the repo first locally and then do the init.

@JustZzzxf
Copy link

@bajras I got the same problem! After format the git repo url, it works. Vue-init get template from remote repo with download-git-repo which check your url format. So, just run:
vue-init -c <host>:<userName>/<repo> <projectName>
Do not add 'ssh://git@' prefix and '.git' suffix. In your case:
vue-init -c bitbucket.moo.com:7999/mac/vue-moo-webpack-boilerplate yay
Try it.

@giulianodb
Copy link

Same error:
'git clone' failed with status 128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests