A repository is the most basic element of GitHub. It's a place where you can store your code, your files, and each file's revision history. Repositories can have multiple collaborators and can be either public, internal, or private.
Before getting started with repositories, learn these important terms.
|A parallel version of your code that is contained within the repository, but does not affect the primary or main branch.
|To download a full copy of a repository's data from GitHub.com, including all versions of every file and folder.
|A new repository that shares code and visibility settings with the original "upstream" repository.
|To take the changes from one branch and apply them to another.
|A request to merge changes from one branch into another.
|A repository stored on GitHub Enterprise Cloud, not on your computer.
|The branch on an original repository that has been forked or cloned. The corresponding branch on the cloned or forked branch is called the "downstream."
You can own repositories individually, or you can share ownership of repositories with other people in an organization.
In either case, access to repositories is managed by permissions. For more information, see "Permission levels for a personal account repository" and "Repository roles for an organization."
You can use repositories to manage your work and collaborate with others.
- You can use issues to collect user feedback, report software bugs, and organize tasks you'd like to accomplish. For more information, see "About issues."
- You can use GitHub Discussions to ask and answer questions, share information, make announcements, and conduct or participate in conversations about a project. For more information, see "About discussions."
- You can use pull requests to propose changes to a repository. For more information, see "About pull requests."
- You can use Projects to organize and prioritize your issues and pull requests. For more information, see "About Projects."
With GitHub Free for personal accounts and organizations, you can work with unlimited collaborators on unlimited public repositories with a full feature set, or unlimited private repositories with a limited feature set. To get advanced tooling for private repositories, you can upgrade to GitHub Pro, GitHub Team, or GitHub Enterprise Cloud. For more information, see "GitHub’s plans."
You can restrict who has access to a repository by choosing a repository's visibility: public, internal, or private.
When you create a repository, you can choose to make the repository public or private. If you're creating the repository in an organization that is owned by an enterprise account, you can also choose to make the repository internal.
- If your account is not a managed user account, you can create public repositories. Public repositories are accessible to everyone on the internet.
- Private repositories are only accessible to you, people you explicitly share access with, and, for organization repositories, certain organization members.
- Internal repositories are accessible to all enterprise members. For more information, see "About internal repositories."
Organization owners always have access to every repository created in an organization. For more information, see "Repository roles for an organization."
People with admin permissions for a repository can change an existing repository's visibility. For more information, see "Setting repository visibility."
If your organization is owned by an enterprise account, you can use internal repositories to practice "innersource" within your enterprise. Members of your enterprise can collaborate using open source methodologies without sharing proprietary information publicly. For more information on innersource, see GitHub's whitepaper "An introduction to innersource."
Note: You can only create internal repositories if you use GitHub Enterprise Cloud with an enterprise account. An enterprise account is a separate type of account that allows a central point of management for multiple organizations. For more information, see "Types of GitHub accounts."
All enterprise members have read permissions to the internal repository, but internal repositories are not visible to people outside of the enterprise, including outside collaborators on organization repositories. For more information, see "Roles in an enterprise" and "Repository roles for an organization."
Internal repositories are the default setting for all new repositories created in an organization owned by an enterprise account.
Unless your enterprise uses Enterprise Managed Users, members of the enterprise can fork any internal repository owned by an organization in the enterprise. The forked repository will belong to the member's personal account, and the visibility of the fork will be private. If a user is removed from all organizations owned by the enterprise, that user's forks of internal repositories are removed automatically.
Note: Managed user accounts cannot fork internal repositories. For more information, see "About Enterprise Managed Users."
Here are some helpful resources for taking your next steps with repositories.
- "Best practices for repositories:" Learn how to use repositories most effectively.
- "Creating a new repository:" Create a new repository.
- "Creating and deleting branches within your repository:" Learn how to create and delete branches within your repository.
- "Creating a pull request:" Create a pull request to propose and collaborate on changes to a repository.