How to Add a New User to a GitHub Repository: A Step-by-Step Guide

Collaborating on code is one of GitHub’s core strengths. If you’re working on a project with others, you’ll eventually need to grant access to new team members. Whether you’re managing an open-source project or a private repository, GitHub makes it easy to invite collaborators and set permission levels.

In this post, we’ll walk you through how to add a new user to your GitHub repository.


👤 Who Can Add Users?

Only users with Admin or Owner permissions on a repository can add collaborators or manage access.


🔐 Private vs. Public Repositories

  • Private Repositories: You must explicitly invite users and assign permissions.
  • Public Repositories: You can still add collaborators for write/admin access, though anyone can view the code.

✅ Step-by-Step: How to Add a New Collaborator

🔧 Method 1: Directly from the Repository Settings

  1. Log in to GitHub and navigate to your repository.
  2. Click on the “Settings” tab (you must have admin access).
  3. In the left sidebar, click “Collaborators and teams” (or “Manage access”).
  4. Click the “Invite a collaborator” button.
  5. Enter the GitHub username or email address of the person you want to add.
  6. Click “Add”, then assign the appropriate permission level:
    • Read: View the repository
    • Triage: Manage issues and pull requests (limited)
    • Write: Push to the repo, create branches
    • Maintain: Manage repo settings without admin rights
    • Admin: Full control
  7. The user will receive an email invitation to accept access.

🏢 Method 2: For Organizations – Add Users via Teams

If your repository is part of a GitHub Organization, you can manage access via teams.

  1. Go to your organization dashboard.
  2. Click “Teams” > select or create a new team.
  3. Add members to the team.
  4. Assign repository access to that team with specific permission levels.

This is the preferred method for larger teams, as it centralizes access control.


🛠 Managing Permissions After Adding

You can always adjust user permissions later:

  1. Go to the repository’s Settings > Collaborators and teams.
  2. Find the user.
  3. Click the dropdown to change their role or remove them.

🧪 Verifying Access

Once the user accepts the invite, they will be able to:

  • Clone the repository
  • Contribute via branches or pull requests
  • Push changes (if granted Write or higher access)

You can verify their access by checking the “People” section under the repo settings.


🧠 Best Practices

  • Avoid granting Admin access unless necessary.
  • Use Teams for better scalability in organizations.
  • Periodically review collaborators and permissions.
  • Use branch protection rules to enforce workflows (e.g., required reviews).

🔒 Bonus: Use GitHub Roles for Enhanced Access Control

For enterprise repositories, GitHub also offers fine-grained personal access tokens, SAML-based role mapping, and audit logs. These are especially useful for compliance and security-sensitive environments.


🎉 Conclusion

Adding users to a GitHub repository is quick and straightforward, but assigning the right level of access is key to maintaining security and productivity. Whether you’re working with one collaborator or managing a large team, GitHub offers flexible tools to keep your workflow organized.

Sharing Is Caring:

Leave a Comment