Git

NOME

git-symbolic-ref - Lê, altera e exclui refs simbólicas

RESUMO

git symbolic-ref [-m <motivo>] <nome> <ref>
git symbolic-ref [-q] [--short] [--no-recurse] <nome>
git symbolic-ref --delete [-q] <nome>

DESCRIÇÃO

Given one argument, reads which branch head the given symbolic ref refers to and outputs its path, relative to the .git/ directory. Typically you would give HEAD as the <name> argument to see which branch your working tree is on.

Quando foi dois argumentos fortem utilizados, cria ou atualiza uma referência simbólica <nome> para apontar para o ramo <ref> informado.

Ao utilizar --delete e um argumento adicional, exclui a referência simbólica informada.

A symbolic ref is a regular file that stores a string that begins with ref: refs/. For example, your .git/HEAD is a regular file whose content is ref: refs/heads/master.

OPÇÕES

-d
--delete

Exclua o <nome> da "ref" simbólica.

-q
--quiet

Não emita uma mensagem de erro caso o <nome> não seja uma referência simbólica, e sim um HEAD desanexado; em vez disso, saia com uma condição diferente de zero de forma silenciosa.

--short

Ao exibir o valor de um <nome> como uma "ref" simbólica, tente encurtar o valor, por exemplo, de refs/heads/master para master.

--recurse
--no-recurse

When showing the value of <name> as a symbolic ref, if <name> refers to another symbolic ref, follow such a chain of symbolic refs until the result no longer points at a symbolic ref (--recurse, which is the default). --no-recurse stops after dereferencing only a single level of symbolic ref.

-m

Update the reflog for <name> with <reason>. This is valid only when creating or updating a symbolic ref.

OBSERVAÇÕES

In the past, .git/HEAD was a symbolic link pointing at refs/heads/master. When we wanted to switch to another branch, we did ln -sf refs/heads/newbranch .git/HEAD, and when we wanted to find out which branch we are on, we did readlink .git/HEAD. But symbolic links are not entirely portable, so they are now deprecated and symbolic refs (as described above) are used by default.

O comando git symbolic-ref encerrará com a condição 0 caso o conteúdo da ref simbólica tenha sido impresso corretamente, com a condição 1 caso o nome solicitado não seja uma ref simbólica ou 128 caso ocorra um outro erro.

GIT

Parte do conjunto git[1]

scroll-to-top