Git
Português (Brasil) ▾Topics ▾Latest version ▾ git-am last updated in 2.45.0

NOME

git-am - Aplica uma série de patches vindas de um mailbox (caixa de correio unix)

RESUMO

git am [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8] [--no-verify]
	 [--[no-]3way] [--interactive] [--committer-date-is-author-date]
	 [--ignore-date] [--ignore-space-change | --ignore-whitespace]
	 [--whitespace=<ação>] [-C<n>] [-p<n>] [--directory=<dir>]
	 [--exclude=<caminho>] [--include=<caminho>] [--reject] [-q | --quiet]
	 [--[no-]scissors] [-S[<keyid>]] [--patch-format=<formato>]
	 [--quoted-cr=<ação>]
	 [--empty=(stop|drop|keep)]
	 [(<mbox> | <Maildir>)…​]
git am (--continue | --skip | --abort | --quit | --show-current-patch[=(diff|raw)]) | --allow-empty)

DESCRIÇÃO

Divide as mensagens de correio num mailbox dentro das mensagens do registro log do commit, as informações de autoria, os patches e as aplica ao ramo atual. Você poderia pensar nisso como uma operação reversa do git-format-patch[1] executado num ramo com um histórico direto e sem mesclagens.

OPÇÕES

(<mbox>|<Maildir>)…​

The list of mailbox files to read patches from. If you do not supply this argument, the command reads from the standard input. If you supply directories, they will be treated as Maildirs.

-s
--signoff

Add a Signed-off-by trailer to the commit message, using the committer identity of yourself. See the signoff option in git-commit[1] for more information.

-k
--keep

Repasse o comando -k para o comando git mailinfo (consulte git-mailinfo[1]).

--keep-non-patch

Repasse o comando -b para o comando git mailinfo (consulte git-mailinfo[1]).

--[no-]keep-cr

With --keep-cr, call git mailsplit (see git-mailsplit[1]) with the same option, to prevent it from stripping CR at the end of lines. am.keepcr configuration variable can be used to specify the default behaviour. --no-keep-cr is useful to override am.keepcr.

-c
--scissors

Remova tudo no corpo antes de uma linha "scissors" (tesouras) (see git-mailinfo[1]). Pode ser ativada de fora predefinida ao utilizar a variável de configuração mailinfo.scissors.

--no-scissors

Ignore linhas "scissors" (tesouras) (veja git-mailinfo[1]).

--quoted-cr=<ação>

Esta opção será passada ao comando git mailinfo (consulte git-mailinfo[1]).

--empty=(stop|drop|keep)

By default, or when the option is set to stop, the command errors out on an input e-mail message lacking a patch and stops in the middle of the current am session. When this option is set to drop, skip such an e-mail message instead. When this option is set to keep, create an empty commit, recording the contents of the e-mail message as its log.

-m
--message-id

Pass the -m flag to git mailinfo (see git-mailinfo[1]), so that the Message-ID header is added to the commit message. The am.messageid configuration variable can be used to specify the default behaviour.

--no-message-id

Do not add the Message-ID header to the commit message. no-message-id is useful to override am.messageid.

-q
--quiet

Fique em silêncio Exiba apenas as mensagens de erro.

-u
--utf8

Pass -u flag to git mailinfo (see git-mailinfo[1]). The proposed commit log message taken from the e-mail is re-coded into UTF-8 encoding (configuration variable i18n.commitEncoding can be used to specify the project’s preferred encoding if it is not UTF-8).

This was optional in prior versions of git, but now it is the default. You can use --no-utf8 to override this.

--no-utf8

Repasse o comando -n para o comando git mailinfo (consulte git-mailinfo[1]).

-3
--3way
--no-3way

Quando o patch não for aplicado corretamente, use a mesclagem de 3 vias caso o patch registre a identidade das bolhas aos quais devem ser aplicadas disponibilizando-as localmente. A opção --no-3way pode ser utilizada para substituir uma variável de configuração de três vias. Para mais informações, consulte am.threeWay em git-config[1].

--rerere-autoupdate
--no-rerere-autoupdate

Após o mecanismo rerere reutilizar uma resolução gravada no conflito atual para atualizar os arquivos na árvore de trabalho, permita que ele também atualize o índice com o resultado da resolução. A opção --no-rerere-autoupdate é uma boa maneira de verificar novamente o que o rerere fez e também detectar possíveis erros da mesclagem antes de enviar o resultado para o índice com um git add separado.

--ignore-space-change
--ignore-whitespace
--whitespace=<ação>
-C<n>
-p<n>
--directory=<dir>
--exclude=<caminho>
--include=<caminho>
--reject

These flags are passed to the git apply (see git-apply[1]) program that applies the patch.

--patch-format

É predefinido que o comando tentará detectar o formato do patch automaticamente. Esta opção permite que o usuário ignore a detecção automática e determine como o formato do patch deve ser interpretados. Os formatos válidos são mbox, mboxrd, stgit, stgit-series e hg.

-i
--interactive

Execute de forma interativa.

-n
--no-verify

By default, the pre-applypatch and applypatch-msg hooks are run. When any of --no-verify or -n is given, these are bypassed. See also githooks[5].

--committer-date-is-author-date

É predefinido que o comando registre a data da mensagem do e-mail como a data do autor que fez o commit e utilize a hora da criação como a data do commit. Permite que usuário minta sobre a data do commit utilizando o mesmo valor da data de quem fez o commit.

--ignore-date

É predefinido que o comando registre a data da mensagem do e-mail como a data do autor que fez o commit e utilize a hora da criação como a data do commit. Permite que usuário minta sobre a data do autor utilizando o mesmo valor da data de quem fez o commit.

--skip

Skip the current patch. This is only meaningful when restarting an aborted patch.

-S[<keyid>]
--gpg-sign[=<keyid>]
--no-gpg-sign

Commits assinados com o GPG O argumento keyid é opcional e a predefinição retorna para a identidade de quem fez o commit; caso seja utilizado, deve estar anexado a opção e sem espaço. A opção --no-gpg-sign é útil para revogar a variável de configuração commit.gpgSign e a anterior --gpg-sign.

--continue
-r
--resolved

After a patch failure (e.g. attempting to apply conflicting patch), the user has applied it by hand and the index file stores the result of the application. Make a commit using the authorship and commit log extracted from the e-mail message and the current index file, and continue.

--resolvemsg=<msg>

When a patch failure occurs, <msg> will be printed to the screen before exiting. This overrides the standard message informing you to use --continue or --skip to handle the failure. This is solely for internal use between git rebase and git am.

--abort

Restore the original branch and abort the patching operation. Revert the contents of files involved in the am operation to their pre-am state.

--quit

Anule a operação de correção, porém mantenha o HEAD e o índice inalterados.

--show-current-patch[=(diff|raw)]

Show the message at which git am has stopped due to conflicts. If raw is specified, show the raw contents of the e-mail message; if diff, show the diff portion only. Defaults to raw.

--allow-empty

Após uma falha do patch numa mensagem de e-mail recebida sem um patch, crie um commit vazio com o conteúdo da mensagem de e-mail como sua mensagem de registro log.

DISCUSSÃO

The commit author name is taken from the "From: " line of the message, and commit author date is taken from the "Date: " line of the message. The "Subject: " line is used as the title of the commit, after stripping common prefix "[PATCH <anything>]". The "Subject: " line is supposed to concisely describe what the commit is about in one line of text.

As linhas que iniciam com "From:" (De:), "Date:" (Data) e "Subject:" (Assunto:) no corpo, substituem os respectivos valores do nome e título do autor do commit que foram retirados dos cabeçalhos.

The commit message is formed by the title taken from the "Subject: ", a blank line and the body of the message up to where the patch begins. Excess whitespace at the end of each line is automatically stripped.

The patch is expected to be inline, directly following the message. Any line that is of the form:

  • três-traços e fim-de-linha, ou

  • uma linha que começa com "diff -" ou

  • uma linha que começa com "Index:"

é tomado como o início de um patch, a mensagem do registro log do commit é finalizado antes da primeira ocorrência de tal linha.

When initially invoking git am, you give it the names of the mailboxes to process. Upon seeing the first patch that does not apply, it aborts in the middle. You can recover from this in one of two ways:

  1. pule o patch atual reexecutando o comando com a opção --skip.

  2. hand resolve the conflict in the working directory, and update the index file to bring it into a state that the patch should have produced. Then run the command with the --continue option.

O comando se recusa a processar as novas caixas de correio até que a operação atual seja concluída, portanto, caso decida recomeçar do zero, execute o comando git am --abort antes de executar o comando com os nomes das caixas de correio.

Before any patches are applied, ORIG_HEAD is set to the tip of the current branch. This is useful if you have problems with multiple commits, like running git am on the wrong branch or an error in the commits that is more easily fixed by changing the mailbox (e.g. errors in the "From:" lines).

GANCHOS

This command can run applypatch-msg, pre-applypatch, and post-applypatch hooks. See githooks[5] for more information.

CONFIGURAÇÃO

Warning

Missing pt_BR/includes/cmd-config-section-all.txt

See original version for this content.

Warning

Missing pt_BR/config/am.txt

See original version for this content.

GIT

Parte do conjunto git[1]

scroll-to-top