I'm deploying my Vite's app through Vercel.
One of the dependencies is a private repository in the Github,
So I've created the personal token and provided it in the package.json
"dependencies": {
...
"my-private-repo": "git+https://<personal_access_token>:x-oauth-basic@github.com/myusename/my-private-repo.git"
},
I've tried to build, Everything seems fine in the local
However, in Vercel build it's throwing me this:
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads https://<personal_access_token>:x-oauth-basic@github.com/myusename/my-private-repo.git
So I've found that git ls-remote
is the actual problem
Here is when I run git ls-remote
with token
git ls-remote https://<personal_access_token>:x-oauth-basic@github.com/myusename/my-private-repo.git
>>> remote: Invalid username or password
And here is when I run git ls-remote
without token
git ls-remote https://github.com/myusename/my-private-repo.git
>>> 9a1daaf0faa44d30afd22121cb8da061d25d9044 refs/heads/main
How come git ls-remote
only work when no credential is provided since this is a private repo? Isn't it weird for Github?
How I can solve this within Vercel config or Github config?