Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
- 2.43.1 → 2.45.2 no changes
- 2.43.0
11/20/23
- 2.10.5 → 2.42.3 no changes
- 2.9.5
07/30/17
- 2.1.4 → 2.8.6 no changes
- 2.0.5
12/17/14
DESCRIÇÃO
This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish scripts and/or are writing new ones.
O scriptlet git sh-setup foi projetado para ser originado (usando .
) através dos outros scripts shell para configurar algumas variáveis apontando para os diretórios normais do Git e algumas funções auxiliares do shell.
Before sourcing it, your script should set up a few variables; USAGE
(and LONG_USAGE
, if any) is used to define the message given by usage()
shell function. SUBDIRECTORY_OK
can be set if the script can run from a subdirectory of the working tree (some commands do not).
O scriptlet define o GIT_DIR
e as variáveis shell GIT_OBJECT_DIRECTORY
, porém não as exporta no ambiente.
FUNÇÕES
- die
encerra após emitir a mensagem de erro informada no fluxo de erros predefinido.
- usage
encerre com a mensagem do consumo.
- set_reflog_action
Set
GIT_REFLOG_ACTION
environment to a given string (typically the name of the program) unless it is already set. Whenever the script runs agit
command that updates refs, a reflog entry is created using the value of this string to leave the record of what command updated the ref.- git_editor
executa um editor selecionado pelo usuário (GIT_EDITOR, core.editor, VISUAL ou EDITOR) em um determinado arquivo, mas com erro caso nenhum editor seja definido e o terminal for burro.
- is_bare_repository
gera
true
oufalse
no fluxo da saída padrão para indicar caso o repositório seja um repositório simples (ou seja, sem uma associação a qualquer árvore de trabalho).- cd_to_toplevel
executa o chdir no nível mais alto da árvore de trabalho.
- require_work_tree
verifica se o diretório atual está dentro da árvore de trabalho do repositório, ou de outra forma, encerre.
- require_work_tree_exists
checks if the working tree associated with the repository exists, and otherwise dies. Often done before calling cd_to_toplevel, which is impossible to do if there is no working tree.
- require_clean_work_tree <ação> [<dica>]
checks that the working tree and index associated with the repository have no uncommitted changes to tracked files. Otherwise it emits an error message of the form
Cannot <action>: <reason>. <hint>
, and dies. Example:require_clean_work_tree rebase "Faça o commit ou armazene-os."
- get_author_ident_from_commit
gera o código para uso com o eval para definir as variáveis
GIT_AUTHOR_NAME
,GIT_AUTHOR_EMAIL
eGIT_AUTHOR_DATE
para um determinado commit.- create_virtual_base
modifica o primeiro arquivo para que apenas as linhas em comum com o segundo arquivo permaneçam. Caso haja um material comum insuficiente, o primeiro arquivo será deixado vazio. O resultado é adequado como uma entrada da base virtual para mesclagem de três vias.
GIT
Parte do conjunto git[1]