title | intro | redirect_from | versions | topics | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
About repositories |
A repository contains all of your code, your files, and each file's revision history. You can discuss and manage your work within the repository. |
|
|
|
A repository is the most basic element of {% data variables.product.prodname_dotcom %}. 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{% ifversion ghes or ghec %}, internal,{% endif %} or private.
To create a new repository, go to https://github.com/new. For instructions, see "AUTOTITLE."
Before getting started with repositories, learn these important terms.
{% rowheaders %}
Term | Definition |
---|---|
Branch | A parallel version of your code that is contained within the repository, but does not affect the primary or main branch. |
Clone | To download a full copy of a repository's data from {% data variables.location.product_location %}, including all versions of every file and folder. |
Fork | A new repository that shares code and visibility settings with the original "upstream" repository. |
Merge | To take the changes from one branch and apply them to another. |
Pull request | A request to merge changes from one branch into another. |
Remote | A repository stored on {% data variables.product.product_name %}, not on your computer. |
Upstream | 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." |
{% endrowheaders %}
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 "AUTOTITLE" and "AUTOTITLE."
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 "AUTOTITLE."{% ifversion fpt or ghec %}
- {% data reusables.discussions.you-can-use-discussions %}{% endif %}
- You can use pull requests to propose changes to a repository. For more information, see "AUTOTITLE."
- You can use {% data variables.product.prodname_projects_v2 %} to organize and prioritize your issues and pull requests. For more information, see "AUTOTITLE."
{% ifversion fpt or ghec %} With {% data variables.product.prodname_free_team %} 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 {% data variables.product.prodname_pro %}, {% data variables.product.prodname_team %}, or {% data variables.product.prodname_ghe_cloud %}. {% data reusables.gated-features.more-info %} {% else %} Each person and organization can own unlimited repositories and invite an unlimited number of collaborators to all repositories. {% endif %}
You can restrict who has access to a repository by choosing a repository's visibility: {% ifversion ghes or ghec %}public, internal, or private{% else %}public or private{% endif %}.
When you create a repository, you can choose to make the repository public or private.{% ifversion ghec or ghes %} If you're creating the repository in an organization{% ifversion ghec %} that is owned by an enterprise account{% endif %}, you can also choose to make the repository internal.{% endif %}{% ifversion fpt %} Repositories in organizations that use {% data variables.product.prodname_ghe_cloud %} and are owned by an enterprise account can also be created with internal visibility. For more information, see the {% data variables.product.prodname_ghe_cloud %} documentation.{% endif %}
{%- ifversion fpt or ghec %}
- {% ifversion ghec %}If your account is not a {% data variables.enterprise.prodname_managed_user %}, you can create public repositories. {% endif %}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. {%- elsif ghes %}
- If {% data variables.location.product_location %} is not in private mode or behind a firewall, public repositories are accessible to everyone on the internet. Otherwise, public repositories are available to everyone using {% data variables.location.product_location %}, including outside collaborators.
- Private repositories are only accessible to you, people you explicitly share access with, and, for organization repositories, certain organization members. {%- endif %} {%- ifversion ghec or ghes %}
- Internal repositories are accessible to all enterprise members. For more information, see "About internal repositories." {%- endif %}
Organization owners always have access to every repository created in an organization. For more information, see "AUTOTITLE."
People with admin permissions for a repository can change an existing repository's visibility. For more information, see "AUTOTITLE."
{% ifversion ghes or ghec %}
{% data reusables.repositories.about-internal-repos %} For more information on innersource, see {% data variables.product.prodname_dotcom %}'s whitepaper "An introduction to innersource."
{% ifversion ghec %} {% note %}
Note: You can only create internal repositories if you use {% data variables.product.prodname_ghe_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 "AUTOTITLE."
{% endnote %} {% endif %}
All enterprise members have read permissions to the internal repository, but internal repositories are not visible to people {% ifversion fpt or ghec %}outside of the enterprise{% else %}who are not members of any organization{% endif %}, including outside collaborators on organization repositories. For more information, see "AUTOTITLE" and "AUTOTITLE."
{% ifversion ghes %} {% note %}
Note: A user must be part of an organization to be an enterprise member and have access to internal repositories. If a user on {% data variables.location.product_location %} is not a member of any organization, that user will not have access to internal repositories.
{% endnote %} {% endif %}
{% data reusables.repositories.internal-repo-default %}
By default, enterprise members can fork an internal repository into any organization where the user can create repositories. Organization owners can also allow users to create a fork owned by a user account, and can manage the forking policy for an organization. Enterprise owners can manage the forking policy for some or all organizations within an enterprise. For more information, see "AUTOTITLE" and "AUTOTITLE."
{% endif %}
Here are some helpful resources for taking your next steps with repositories.