β By default, only YOU can modify the main branch β Others can only suggest changes via Pull Requests β You must approve every change before it goes live
- Owner: You (full control)
- Collaborators: Anyone you specifically invite (limited permissions)
- Everyone else: Can fork, report issues, suggest changes via PR
| Action | Default? | Can Prevent? |
|---|---|---|
| Fork your repo | β Yes | No (it's open source) |
| Create Pull Requests | β Yes | Can be disabled |
| Push to main branch | β NO | N/A |
| Merge PRs | β NO | Can add extra rules |
| Delete repository | β NO | N/A |
| Change settings | β NO | N/A |
| Access your issues | β Yes | Can mark as private |
- Go to: https://github.com/vineet454/PromptZip
- Click Settings (top right)
- Click Branches (left sidebar)
- Click Add rule under "Branch protection rules"
- Enter
mainas the branch name - Check these options:
β
Require pull request reviews before merging
ββ Required number of approvals: 1
ββ Require review from code owners
β
Require status checks to pass before merging
ββ GitHub Actions (tests must pass)
β
Require branches to be up to date before merging
β
Dismiss stale pull request approvals when new commits are pushed
β
Restrict who can push to matching branches
ββ Only allow specified people to push
- Click Create
- Create a file named
CODEOWNERSin the root:
# CODEOWNERS
# @vineet454 is the owner of everything
* @vineet454
- Commit and push:
git add CODEOWNERS
git commit -m "Add CODEOWNERS file"
git push- Now you'll automatically be requested for review on all PRs
- Go to Settings
- Scroll to Features
- Uncheck Discussions (if you don't want them)
If someone submits a PR you don't want:
- Open the Pull Request
- Scroll to bottom
- Click Close pull request
- Add a comment explaining why (e.g., "This repository is not accepting contributions at this time")
- The PR closes without merging
β Repository: https://github.com/vineet454/PromptZip β Visibility: Public (anyone can see it) β Write Access: Only you β Push Protection: Default GitHub protection active β Pull Requests: You control all merges
Owner: @vineet454 β
Collaborators: None (unless you invite)
Branch Protection: Recommended (instructions above)
Pull Request Reviews: Recommended (you are sole reviewer)
CI/CD Tests: Already configured β
(runs on all PRs)
- β Free
- β Anyone can see your code
- β Anyone can fork it
- β You control all direct changes
- β Good for community contributions
- Only people you invite can see it
- GitHub Personal plans offer private repos
- More restrictive, less open source
- Branch protection: No
- Reviews required: No
- Anyone can submit PRs
- Risk: Low (you control merges)
- Recommendation: Good for open source
- Branch protection: Yes
- Reviews required: Yes (from you)
- Tests must pass
- Stale reviews dismissed
- Risk: Very Low
- Recommendation: Best for most projects
- All from Option 2, plus:
- Only you can push (even after PR approval)
- Require admin approval for merges
- Require all conversations resolved
- Risk: None
- Recommendation: For critical projects only
Your code is protected by default!
- β No one can directly edit your main branch
- β All changes go through Pull Requests
- β You approve or reject every change
- β GitHub tracks who changed what
- β You can revert any merge instantly
If you don't want ANY contributions:
- Go to Settings
- Click Features
- Uncheck Sponsorships and Discussions
- Edit
CONTRIBUTING.mdto say "This project is not accepting contributions" - People can still fork it, but won't be encouraged to contribute
# See the commit you want to undo
git log --oneline
# Revert the commit
git revert <commit-hash>
# Push the revert
git pushThe bad change will be undone instantly!
Your GitHub Repository Security Status:
βββββββββββββββββββββββββββββββββββββ
β
Only you can push to main
β
All PRs require your approval
β
CI/CD tests run automatically
β
Changes are tracked
β
You can revert anything
β
Your code is safe!
βββββββββββββββββββββββββββββββββββββ
Recommendation: Follow Option 2 (Medium Security) for the best balance between security and open-source collaboration.
Need help with setup? Check the instructions above!