Olá! No momento, esta página ainda está sendo desenvolvida ou traduzida. Para obter as informações mais recentes, acesse a documentação em inglês.
Versão do artigo: Enterprise Server 2.15

Esta versão do GitHub Enterprise será descontinuada em Esta versão do GitHub Enterprise foi descontinuada em 2019-10-16. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Sobre métodos de merge no GitHub

Você pode permitir que contribuidores com acesso push ao seu repositório façam merge das respectivas pull requests no sua instância do GitHub Enterprise Server com diferentes opções de merge ou apliquem um método de merge específico para todas as pull requests do seu repositório.

You can configure pull request merge options on sua instância do GitHub Enterprise Server to meet your workflow needs and preferences for managing Git history. É possível aplicar um tipo de método de merge, como combinação por squash ou rebase de commit, apena habilitando o método desejado para o repositório.

When you click the default Merge pull request option on a pull request on sua instância do GitHub Enterprise Server, all commits from the feature branch are added to the base branch in a merge commit. The pull request is merged using the --no-ff option.

To merge pull requests, you must have write permissions in the repository.

standard-merge-commit-diagram

Combinar por squash os commits de merge

When you select the Squash and merge option on a pull request on sua instância do GitHub Enterprise Server, the pull request's commits are squashed into a single commit. Instead of seeing all of a contributor's individual commits from a topic branch, the commits are combined into one commit and merged into the default branch. Pull requests with squashed commits are merged using the fast-forward option.

To squash and merge pull requests, you must have write permissions in the repository, and the repository must allow squash merging.

commit-squashing-diagram

You can use squash and merge to create a more streamlined Git history in your repository. Work-in-progress commits are helpful when working on a feature branch, but they aren’t necessarily important to retain in the Git history. If you squash these commits into one commit while merging to the default branch, you can retain the original changes with a clear Git history.

Antes de habilitar a combinação de commits por squash, considere estas desvantagens:

Para obter mais informações, consulte "Configurar combinação de commits por squash para pull requests".

Fazer rebase e merge de seus commits

When you select the Rebase and merge option on a pull request on sua instância do GitHub Enterprise Server, all commits from the topic branch (or head branch) are added onto the base branch individually without a merge commit. Pull requests with rebased commits are merged using the fast-forward option.

To rebase and merge pull requests, you must have write permissions in the repository, and the repository must allow rebase merging.

The rebase and merge behavior on GitHub Enterprise deviates slightly from git rebase. Rebase and merge on GitHub will always update the committer information and create new commit SHAs, whereas git rebase outside of GitHub does not change the committer information when the rebase happens on top of an ancestor commit. For more information about git rebase, see the "Git rebase" chapter from the Pro Git book.

For a visual representation of git rebase, see The "Git Branching - Rebasing" chapter from the Pro Git book.

Antes de habilitar o rebase de commit, leve em consideração estas desvantagens:

Para obter mais informações, consulte "Configurar rebase de commit para pull requests".

Pergunte a uma pessoa

Não consegue encontrar o que procura?

Entrar em contato