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
Guides
- gitattributes
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- Glossary
- Hooks
- gitignore
- gitmodules
- Revisions
- Submodules
- Tutorial
- Workflows
- All guides...
Administration
Plumbing Commands
-
2.50.0
2025-06-16
- 2.44.1 → 2.49.0 no changes
-
2.44.0
2024-02-23
- 2.43.1 → 2.43.6 no changes
-
2.43.0
2023-11-20
- 2.39.1 → 2.42.4 no changes
-
2.39.0
2022-12-12
- 2.10.5 → 2.38.5 no changes
-
2.9.5
2017-07-30
- 2.1.4 → 2.8.6 no changes
-
2.0.5
2014-12-17
RESUMO
git mv [-v] [-f] [-n] [-k] <source> <destination> git mv [-v] [-f] [-n] [-k] <source>… <destination-directory>
DESCRIÇÃO
Move ou renomeia um arquivo, diretório ou link simbólico.
In the first form, it renames <source>, which must exist and be either a file, symlink or directory, to <destination>. In the second form, <destination-directory> has to be an existing directory; the given sources will be moved into this directory.
O índice é atualizado após a conclusão bem-sucedida, mas a alteração ainda deve ser confirmada.
OPÇÕES
-
-f
-
--force
-
Impõem a renomeação ou o deslocamento de um arquivo, mesmo que o <destino> exista.
-
-k
-
Ignorar um ato de mover ou renomear as ações que levariam a uma condição de erro. Um erro acontece quando uma fonte não existe nem é controlada pelo Git ou quando ela substituiria um arquivo existente a menos que
-f
seja utilizado. -
-n
-
--dry-run
-
Não faça nada; apenas exiba o que aconteceria
-
-v
-
--verbose
-
Relate os nomes dos arquivos conforme eles vão sendo movidos.
SUBMÓDULOS
Moving a submodule using a gitfile (which means they were cloned with a Git version 1.7.8 or newer) will update the gitfile and core.worktree setting to make the submodule work in the new location. It also will attempt to update the submodule.<name>.path
setting in the gitmodules[5] file and stage that file (unless -n
is used).
BUGS
Sempre que uma atualização do superproject
move um submódulo preenchido (por exemplo, ao alternar entre commits antes e depois da mudança), um checkout
obsoleto do submódulo permanecerá no local antigo e um diretório vazio aparecerá no novo local. Para preencher o submódulo novamente no novo local, o usuário precisará depois, executar o comando git submodule update
. A remoção do diretório antigo só é segura quando ele usa um gitfile
; caso contrário, o histórico do submódulo também será excluído. Ambas as etapas ficarão obsoletas quando a atualização recursiva do submódulo for implementada.
GIT
Parte do conjunto git[1]