By default, no, a random person cannot directly edit (push changes to) your public GitHub repository. Only the repository owner and explicitly added collaborators have direct push access.
- Forking: A user creates their own copy (a fork) of your repository in their GitHub account.
- Making Changes: They make their edits, commits, and additions within their own fork, where they have full control.
- Proposing Changes (Pull Request): Once they are ready, they send a "pull request" to your original repository.
- Review and Merge: You, as the repository owner, then review the proposed changes and decide whether to accept and "merge" them into your main repository's codebase.
- Navigate to the main page of your repository.
- Click on the Settings tab.
- In the left sidebar, click on Collaborators & teams (or Manage access).
- Under "Manage access", click Add people.
- Search for their GitHub username and select the appropriate permission level (e.g., "Write").
- Wikis: By default, only collaborators can edit a public repository's wiki, but you can change a setting to allow anyone with a GitHub account to edit it
. - Branch Protection Rules: You can set up rules to enforce specific checks (like requiring reviews or signed commits) even for collaborators on important branches (like the default branch), adding another layer of control over the editing process.