Skip to main content

Esta versão do GitHub Enterprise foi descontinuada em 2022-10-12. Nenhum lançamento de patch será feito, mesmo para questões críticas de segurança. Para obter melhor desempenho, segurança aprimorada e novos recursos, atualize para a última versão do GitHub Enterprise. Para obter ajuda com a atualização, entre em contato com o suporte do GitHub Enterprise.

About forks

A fork is a copy of a repository that you manage. Forks let you make changes to a project without affecting the original repository. You can fetch updates from or submit changes to the original repository with pull requests.

Forking a repository is similar to copying a repository, with two major differences:

  • You can use a pull request to suggest changes from your user-owned fork to the original repository in its GitHub instance, also known as the upstream repository.
  • You can bring changes from the upstream repository to your local fork by synchronizing your fork with the upstream repository.

You can fork a private or internal repository to your personal account or an organization on your GitHub Enterprise Server instance where you have repository creation permissions, if settings for the repository and your enterprise policies allow forking.

Você pode usar GitHub Desktop para bifurcar um repositório. Para obter mais informações, confira "Como clonar repositórios e criar forks deles no GitHub Desktop".

Deleting a fork will not delete the original upstream repository. You can make any changes you want to your fork—add collaborators, rename files, generate GitHub Pages—with no effect on the original.

In open source projects, forks are often used to iterate on ideas or changes before they are offered back to the upstream repository. When you make changes in your user-owned fork and open a pull request that compares your work to the upstream repository, you can give anyone with push access to the upstream repository permission to push changes to your pull request branch (including deleting the branch). This speeds up collaboration by allowing repository maintainers the ability to make commits or run tests locally to your pull request branch from a user-owned fork before merging. You cannot give push permissions to a fork owned by an organization.

As bifurcações privadas herdam a estrutura de permissões do repositório ascendente ou principal. Isso ajuda os proprietários de repositórios privados a manter o controle sobre seus códigos. Por exemplo, se o repositório ascendente é privado e fornece acesso de leitura/gravação a uma equipe, essa equipe terá acesso de leitura/gravação para qualquer bifurcação do repositório privado ascendente. Somente as permissões de equipe (não as permissões individuais) são herdadas por forks privados.

If you want to create a new repository from the contents of an existing repository but don't want to merge your changes to the upstream in the future, you can duplicate the repository or, if the repository is a template, you can use the repository as a template. For more information, see "Duplicating a repository" and "Creating a repository from a template".

Further reading