mv

NAME

git-mv - Move or rename a file, a directory, or a symlinkgit-mv - ファイル、ディレクトリ、またはシンボリックリンクを移動または名前変更する

SYNOPSIS概要

git mv <options>…​ <args>…​

DESCRIPTION説明

Move or rename a file, directory or symlink.ファイル、ディレクトリ、またはシンボリックリンクを移動または名前変更します。

git mv [-v] [-f] [-n] [-k] <source> <destination>
git mv [-v] [-f] [-n] [-k] <source> ... <destination directory>

In the first form, it renames <source>, which must exist and be either a file, symlink or directory, to <destination>. In the second form, the last argument has to be an existing directory; the given sources will be moved into this directory.最初の形式では、<source>を<destination>に変更します。これは存在し、ファイル、シンボリックリンク、またはディレクトリのいずれかである必要があります。2番目の形式では、最後の引数は既存のディレクトリでなければなりません。与えられたソースはこのディレクトリに移動されます。

The index is updated after successful completion, but the change must still be committed.索引は正常に完了した後に更新されますが、それでも変更をコミットする必要があります。

OPTIONSオプション

-f
--force - 力

Force renaming or moving of a file even if the target existsターゲットが存在する場合でもファイルの名前変更またはファイルの移動を強制します

-k

Skip move or rename actions which would lead to an error condition. An error happens when a source is neither existing nor controlled by Git, or when it would overwrite an existing file unless -f is given.移動をスキップするか、エラー状態につながる可能性のある操作の名前を変更します。ソースがGitによって存在も制御もされていない場合、または-f指定されていない限り既存のファイルを上書きする場合にエラーが発生します。

-n
--dry-run

Do nothing; only show what would happen何もしない; 何が起こるかを示すだけ

-v
--verbose - 冗談

Report the names of files as they are moved.移動したファイルの名前を報告します。

SUBMODULESサブモジュール

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).gitfileを使用してサブモジュールを移動すると(Gitバージョン1.7.8以降でクローン作成されたことを意味します)、gitfileとcore.worktreeの設定が更新され、サブモジュールが新しい場所で機能するようになります。また、gitmodules [5]ファイルのsubmodule。<name> .path設定を更新し、そのファイルをステージングします(-nが使用されていない限り)。

BUGSバグ

Each time a superproject update moves a populated submodule (e.g. when switching between commits before and after the move) a stale submodule checkout will remain in the old location and an empty directory will appear in the new location. To populate the submodule again in the new location the user will have to run "git submodule update" afterwards. Removing the old directory is only safe when it uses a gitfile, as otherwise the history of the submodule will be deleted too. Both steps will be obsolete when recursive submodule update has been implemented.スーパープロジェクトの更新が移入されたサブモジュールを移動するたびに(例えば移動の前後でコミットを切り替えるとき)、古いサブモジュールのチェックアウトは古い場所に残り、新しいディレクトリに空のディレクトリが現れます。新しい場所にサブモジュールを再度追加するには、ユーザーは後で "git submodule update"を実行する必要があります。古いディレクトリを削除しても、gitfileを使用している場合にのみ安全です。それ以外の場合は、サブモジュールの履歴も削除されます。再帰的サブモジュールの更新が実装されている場合は、どちらの手順も使用されなくなります。

GIT

Part of the git[1] suite一部のgit [1]スイート

関連記事

スポンサーリンク

REGR_SYY関数 回帰モデルの統計的有効性を評価できる値を返す

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る