Reputation: 2773
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.
Upvotes: 190
Views: 341063
Reputation: 11502
Here's a hacky way of creating an invite link for a private repo.
This will (at the time of writing) generate an invitation link for someone to either login or create a new account to access your repository. The link will last for 7 days.
This link should look something like:
https://github.com/{username}/{repository}/invitations?invitation_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Even though this was generated for the temporary email address, anyone can create an account with any email through this link.
You now have a link you can share with anyone to give them access to your repository.
Upvotes: 2
Reputation: 795
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:
Under your user profile go to Settings > Developer Settings > Personal access tokens > Fine-grained tokens > Generate new token.
Select the repositories you want to share under Repository access > Only select repositories.
Set the access level of the token to read-only in Permissions > Repository permissions > Contents > Access: read-only.
Finally, click on Generate token.
Upvotes: 68
Reputation: 1631
Use https://gitfront.io/. The steps to follow are:
Get Started
.[email protected]:your_username/repo_name.git
Repository URL
. Press Add
.Open repository Deploy keys on GitHub.
Upvotes: 71
Reputation: 1217
You can use gitfront.io for this purpose. You can give users to read-only access to keep your secure
Upvotes: 67
Reputation: 24298
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.
Upvotes: 132