命令格式

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

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

 

命令参数

-f, --force
  即使目标文件存在也强制重命名或移动文件。

-k
  当移动或重命名操作会导致错误发生时则跳过。

-n, --dry-run
  不执行任何操作,仅仅显示将会发生什么。

-v, --verbose
  详细模式。

 

实例

a) 将 testfile.txt 重命名为 test.conf。

git mv testfile.txt test.conf

b) 将 test.conf 移动至 src 目录下。

git mv test.conf src/

 

相关文章:

  • 2021-08-01
  • 2021-06-04
  • 2021-08-02
  • 2022-02-28
  • 2022-12-23
  • 2021-06-03
  • 2022-03-08
  • 2021-09-01
猜你喜欢
  • 2021-08-09
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2021-06-18
  • 2021-09-29
  • 2022-12-23
相关资源
相似解决方案