160

I have a Java application in a private repository on GitHub and I would like to share it with someone who doesn't have an account. I didn't find any option on the site for this.

Is there a way to do this? Collaborators can be only GitHub users.

Loci
  • 327
  • 5
  • 16
gaRos
  • 2,463
  • 6
  • 22
  • 27

4 Answers4

120

There is no way to share private repository among non-Github users.

You need the Github account and be added as collaborator to the project.

Tomas Votruba
  • 23,240
  • 9
  • 79
  • 115
63

You can use gitfront.io for this purpose. You can give users to read-only access to keep your secure

Karthik SWOT
  • 1,129
  • 1
  • 11
  • 15
54

Use https://gitfront.io/. The steps to follow are:

  1. Visit the https://gitfront.io/ page and click on Get Started.
  2. Click on Add Repository.
  3. Copy the link to the private repository you want to share using SSH. It should look something like git@github.com:your_username/repo_name.git

SSH Link on github

  1. Paste it where it says Repository URL. Press Add.

Repository Form in gitfront

  1. Copy the key shown in the text box and click on Open repository Deploy keys on GitHub.

Key generation on gitfront

  1. Add the deploy key to github.

Add a deploy key on github

  1. Hit Build and it will generate a url that you can view and share by clicking the View button.
Jaime Menendez
  • 1,323
  • 1
  • 9
  • 13
  • 1
    I have followed the steps but I have a size of repository greater than 100MB. So is there anotehr way to share for free? – Kenan Morani Apr 11 '23 at 10:12
0

You can use read-only access token to share a private repository.

git clone https://<username>:<token>@github.com/<username>/<repo>.git

To generate a new token:

  1. Go to Settings > Developer Settings > Personal access tokens > Fine-grained tokens > Generate new token.

  2. Select the repositories you want to share under Repository access > Only select repositories.

  3. Set the access level of the token to read-only in Permissions > Repository permissions > Contents > Access: read-only.

  4. Finally, click on Generate token.