Amending a commit

You can use GitHub Desktop to amend your last commit.

About amending a commit

Amending a commit is a way to modify the most recent commit you have made in your current branch. This can be helpful if you need to edit the commit message or if you forgot to include changes in the commit.

You can continue to amend a commit until you push it to the remote repository. After you push a commit, the option to amend it is disabled in GitHub Desktop. When you amend a commit, you replace the previous commit with a new commit to your current branch. Amending a commit that has been pushed to the remote repository could cause confusion for other collaborators working with the repository.

Amending a commit

  1. Clique em History (Histórico). Aba history (histórico) selecionada na barra lateral
  2. Right-click on the most recent commit and select Amend commit. Amend commit context menu
  3. Click the Summary field to modify the commit message. Optionally, you can modify or add information about the commit in the Description field.
  4. Select any uncommitted changes that you would like to add to the commit. For more information about selecting changes, see "Committing and reviewing changes to your project."
  5. Once you have finalized your changes, click Amend last commit. Amend last commit overview

Esse documento ajudou você?Política de Privacidade

Ajude-nos a tornar esses documentos ótimos!

Todos os documentos do GitHub são de código aberto. Você percebeu que algo que está errado ou não está claro? Envie um pull request.

Faça uma contribuição

Ou, aprenda como contribuir.