diff --git a/lib/util/git.js b/lib/util/git.js index c28760db..681af788 100644 --- a/lib/util/git.js +++ b/lib/util/git.js @@ -23,7 +23,7 @@ const getRemoteUrl = async (path, remote) => { try { const urlStr = await tryGit(path, 'remote', 'get-url', remote) const { domain, user, project } = hgi.fromUrl(urlStr) - const url = new URL(`https://${domain}`) + const url = new URL(`git+https://${domain}`) url.pathname = `/${user}/${project}.git` return url.toString() } catch { diff --git a/package.json b/package.json index b20dfb4f..4f88b817 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/npm/template-oss.git" + "url": "git+https://github.com/npm/template-oss.git" }, "keywords": [ "npm", diff --git a/workspace/test-workspace/package.json b/workspace/test-workspace/package.json index 4f304a50..cd0d379d 100644 --- a/workspace/test-workspace/package.json +++ b/workspace/test-workspace/package.json @@ -20,7 +20,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/npm/template-oss.git", + "url": "git+https://github.com/npm/template-oss.git", "directory": "workspace/test-workspace" }, "keywords": [],