Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can anyone upload changes and commit to my github repository is it is public?

Tags:

git

github

First of all, sorry because I know it might seem a little dumb question, but I´m new in github and I want to know that. If I make a github repository and it is public, I can commit and upload changes, but can any other person do that too? If the answer is yes, is there a way to share a repository with someone, but just for him to see it and download it but not being able to commit or change anything? Thank you.

like image 918
Luis Daniels Avatar asked Sep 10 '25 03:09

Luis Daniels


1 Answers

So, you have a few questions I will answer each to the best of my ability below.

If I make a github repository and it is public, I can commit and upload changes, but can any other person do that too?

No. Anyone can SEE your code, but they cannot change it without your permission. There are permissions to allow others to send PRs, to fork, and to collaborate. You can change these on a public repo.

For example:

Pulls and Reviews

Forking

...is there a way to share a repository with someone, but just for him to see it and download it but not being able to commit or change anything?

Yes. You can either make the repository private (as an organization) and invite someone with read only permissions or keep it public and disable comments, PRs, and forks.

As a general comment be sure to NEVER upload any private info to your repo, even if it is set to private. This includes API keys, passwords, etc.

like image 175
Code2Empower Avatar answered Sep 12 '25 18:09

Code2Empower