Git
Português (Brasil) ▾Topics ▾Latest version ▾ git-show-branch last updated in 2.43.0

NOME

git-show-branch - Exibe as ramificações e o seus commits

RESUMO

git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]
		[--current] [--color[=<when>] | --no-color] [--sparse]
		[--more=<n> | --list | --independent | --merge-base]
		[--no-name | --sha1-name] [--topics]
		[(<rev> | <glob>)…​]
git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]

DESCRIÇÃO

Exibe o grafo da ancestralidade do commit, começando pelos commits informados com <rev>s ou <glob>s (ou todos as refs em refs/heads e/ou refs/tags) de forma semi-visual.

Não pode exibir mais de 29 ramificações e commits por vez.

Ele utiliza itens de configuração showbranch.default com vários valores caso nenhuma <rev> ou <glob> seja utilizado na linha de comando.

OPÇÕES

<rev>

Arbitrary extended SHA-1 expression (see gitrevisions[7]) that typically names a branch head or a tag.

<glob>

A glob pattern that matches branch or tag names under refs/. For example, if you have many topic branches under refs/heads/topic, giving topic/* would show all of them.

-r
--remotes

Exibe os ramos monitorados remotamente.

-a
--all

Exibe ambos os ramos monitorados remotamente e o ramos locais.

--current

Com esta opção, o comando inclui o ramo atual na lista das "revs" que serão exibidas quando não for utilizada na linha de comando.

--topo-order

By default, the branches and their commits are shown in reverse chronological order. This option makes them appear in topological order (i.e., descendant commits are shown before their parents).

--date-order

Essa opção é semelhante à --topo-order, no sentido onde nenhum pai vem antes de todos os herdeiros, porém, caso contrário, os commits são ordenadas de acordo com a data do commits.

--sparse

By default, the output omits merges that are reachable from only one tip being shown. This option makes them visible.

--more=<n>

Usually the command stops output upon showing the commit that is the common ancestor of all the branches. This flag tells the command to go <n> more common commits beyond that. When <n> is negative, display only the <ref>s given, without showing the commit ancestry tree.

--list

É um sinônimo para a opção --more=-1

--merge-base

Em vez de exibir a lista do commit, determine as possíveis bases para mesclagem para determinados commits. Todas as mesclagens das bases estarão contidas em todos os commits informados. Isso é diferente de como o git-merge-base[1] lida com o caso de três ou mais commits.

--independent

Entre as <ref>s fornecidas, exiba apenas as que não podem ser acessadas de nenhuma outra <ref>.

--no-name

Não exiba o texto informado dos nomes para cada commit.

--sha1-name

Em vez de nomear os commits utilizando o caminho para alcançá-los através dos cabeçalhos ("master~2" para significar o avô do "master" por exemplo), nomeie-os com o prefixo exclusivo dos nomes dos seus objetos.

--topics

Shows only commits that are NOT on the first branch given. This helps track topic branches by hiding any commit that is already in the main line of development. When given "git show-branch --topics master topic1 topic2", this will show the revisions given by "git rev-list ^master topic1 topic2"

-g
--reflog[=<n>[,<base>]] [<ref>]

Shows <n> most recent ref-log entries for the given ref. If <base> is given, <n> entries going back from that entry. <base> can be specified as count or date. When no explicit <ref> parameter is given, it defaults to the current branch (or HEAD if it is detached).

--color[=<quando>]

Color the status sign (one of these: * ! + -) of each commit corresponding to the branch it’s in. The value must be always (the default), never, or auto.

--no-color

Turn off colored output, even when the configuration file gives the default to color output. Same as --color=never.

Observe que as opções --more, --list, --independent e --merge-base são mutuamente exclusivas.

SAÍDA

Dadas N <ref>s, as primeiras N linhas são a descrição de uma linha da sua mensagem do commit. O cabeçalho do ramo apontado por $GIT_DIR/HEAD é prefixado com um caractere asterisco *, enquanto os outros cabeçalhos são prefixados com um caractere !.

Following these N lines, a one-line log for each commit is displayed, indented N places. If a commit is on the I-th branch, the I-th indentation character shows a + sign; otherwise it shows a space. Merge commits are denoted by a - sign. Each commit shows a short name that can be used as an extended SHA-1 to name that commit.

O exemplo a seguir mostra três ramificações, master (mestres), fixes (correções) e mhf:

$ git show-branch master fixes mhf
* [master] Add 'git show-branch'.
 ! [fixes] Introduz a flag "reset type" para "git reset"
  ! [mhf] Permite que o refspec "+remote:local" cause --force quando for buscar.
---
  + [mhf] Permite que o refspec "+remote:local" cause --force quando for buscar.
  + [mhf~1] Usa git-octopus quando for capturar mais de um cabeçalho.
 +  [fixes] Introduz a sinalização "reset type" para "git reset"
  + [mhf~2] "git fetch --force".
  + [mhf~3] Utilize .git/remote/origin, e não .git/branches/origin.
  + [mhf~4] Faz um "git pull" e "git fetch" retornar para a predefinição no "origin"
  + [mhf~5] Infame 'octopus merge'
  + [mhf~6] Retira git-parse-remote.
  + [mhf~7] Multi-head fetch.
  + [mhf~8] Começa a adicionar a compatibilidade com o $GIT_DIR/remotes/.
*++ [master] Adiciona 'git show-branch'.

These three branches all forked from a common commit, [master], whose commit message is "Add 'git show-branch'". The "fixes" branch adds one commit "Introduce "reset type" flag to "git reset"". The "mhf" branch adds many other commits. The current branch is "master".

EXEMPLOS

Caso mantenha os seus ramos principais imediatamente sob refs/heads e tópico dos ramos nos subdiretórios, ter o seguinte no arquivo de configuração pode ajudar:

[showbranch]
	default = --topo-order
	default = heads/*

With this, git show-branch without extra parameters would show only the primary branches. In addition, if you happen to be on your topic branch, it is shown as well.

$ git show-branch --reflog="10,1 horas atrás" --list master

shows 10 reflog entries going back from the tip as of 1 hour ago. Without --list, the output also shows how these tips are topologically related to each other.

CONFIGURAÇÃO

Warning

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

See original version for this content.

Warning

Missing pt_BR/config/showbranch.txt

See original version for this content.

GIT

Parte do conjunto git[1]

scroll-to-top