OneOfOne / git-go-vendor

Simple go vendoring using git submodules.
12 stars 2 forks source link

Support git SSH mode #2

Open mohanraj-r opened 6 years ago

mohanraj-r commented 6 years ago

Thanks for this cool util 👍

Found that it errors when using ssh git@....git url

$ git-go-vendor -v add git@github.com:stretchr/testify.git github.com/stretchr/testify
* Executing git submodule add --force https://git vendor/github.com/stretchr/testify
* Executing git -C vendor/github.com/stretchr/testify checkout github.com:stretchr/testify.git
error: pathspec 'github.com:stretchr/testify.git' did not match any file(s) known to git.

Works after switching to https url.

OneOfOne commented 6 years ago

Glad you found it useful!

Sadly the url parser is extremely simple and expects that anything after @ is the commit hash, any PRs are welcome though.

However there's a quick workaround that doesn't involve changing the code, check:

https://www.quernus.co.uk/2015/10/22/force-git-to-use-ssh/