8

I'm still new to deploying apps/web apps. Just wanted to confirm if will I be able build and deploy a Github private repo using Vercel? I'm going to try if ever there would be a way as I'm still hesitant to use it in an existing deployed repo and make it private. Thank you very much.

Shironekomaru
  • 361
  • 1
  • 6
  • 15

3 Answers3

16

You can deploy private repositories if you go to profile > settings > application > vercel, this is the link : Github applications

And add your repo under the Repository access.

Now you can find the repo listed in your vercel profile.

AWIXOR
  • 406
  • 4
  • 15
  • 4
    this should be the accepted answer. Vercel supports private GitHub repositories and I just had to add my private repo under Repository access. – kimbaudi Jun 18 '22 at 21:54
  • 1
    mm, im lost, I dont the "respostitory access" to add to – Ayyash Feb 04 '23 at 14:39
4

New Update

It's been a couple of months Vercel now supports Private Repositories from the user's GitHub.

Edited:

Since Vercel doesn't support private GitHub repositories for whatever reasons, you can still deploy private GIT repos using BitBucket. See the details here: https://vercel.com/docs/concepts/git#deploying-private-git-repositories

Thanks to Lucas Basquerotto for that information


Unfortunately, Vercel does not support private git repositories. If you want to deploy a private repo, you have to make it public first. However, you can deploy projects directly from your machine using the Vercel CLI.

For more information, you can go through this documentation.

Moeen
  • 64
  • 6
  • 1
    I don't see any reference about not being able to deploy a private repository, neither in the link you posted nor elsewhere. There's even a section in their docs about private repositories (https://vercel.com/docs/concepts/git#deploying-private-git-repositories). Actually, I just deployed a private bitbucket git repository. One thing, tough, is that Vercel wasn't able to "see" the private repositories that I had read (or write) access if I'm not the owner. Instead, I had to fork the repository and become the owner, and then I used the forked repository instead of the original. – Lucas Basquerotto Nov 03 '21 at 15:54
  • Could you kindly describe in detail? If I have a private repo, then I'm the owner obviously. But when I try to import my personal private repo, Vercel couldn't find it. I tried with 'Import third-party git repo' option but it shows an error. – Moeen Nov 04 '21 at 13:03
  • 1
    I used the normal option (not the third party) yesterday and i worked. I used Bitbucket, after the login with Bitbucket, it showed the workspaces that I have, I choose the one in which I had my repositories and it showed them (those that are in the form `/your-name/your-repo`, not those that are in the form `/some-other-name/some-repo`, belonging to another user or organisation, even if I have admin access to the repository). Just make sure you select the correct Bitbucket workspace in the dropdown (if it's a Github repo I assume the steps are similar, but have not tried). – Lucas Basquerotto Nov 04 '21 at 14:11
  • I followed as you said. It worked perfectly with private repos in BitBucket but It didn't work for GitHub. Could you please try it with GitHub? I couldn't do that. If I'm wrong, please correct me. – Moeen Nov 05 '21 at 11:49
  • 1
    I don't have a private repository at github, tough :/ You could explain your issue at https://github.com/vercel/vercel/discussions and see if someone there can solve for you. – Lucas Basquerotto Nov 05 '21 at 12:13
  • Thanks so much... – Moeen Nov 05 '21 at 17:29
  • This answer seems wrong. Vercel does support private github repos, but you need to select which repos vercel can access. See @AWIXOR's answer – kimbaudi Jun 18 '22 at 21:50
0

Now we can deploy Github private repo with vercel cli aslo, from your workspace.

Note - If you just wanted to validate the changes from your local this is the right way to deploy. It's always recommended to sync your github repo with your latest commit.

Step 1. download and install vercel

 npm i -g vercel

Step 2. Link your working directory vercel project vc link This would provide few setup instruction to connect to your vercel account. enter image description here

Step 3. Now you can deploy your code to vercel with

  vc deploy
Pravanjan
  • 698
  • 7
  • 16