17.移动文件
第一种方式:使用 Git 命令操作
描述
命令
# 创建 lab 文件夹
$ mkdir lab
# 移动文件到lab目录
$ git mv test.txt lab
# 查看 Git 状态
$ git status
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
renamed: test.txt -> lab/test.txt
# 提交更改
$ git commit -m "Moved test.txt to lab"
[master 40e4259] Moved test.txt to lab
1 file changed, 0 insertions(+), 0 deletions(-)
rename test.txt => lab/test.txt (100%)
# 查看提交记录
$ git hist
* d84d6fa 2023-05-05 | Moved test.txt to lab (HEAD -> master) [aku]
* 929f644 2023-05-05 | Added 123456 to the test.txt [aku]
* d7f681f 2023-05-05 | Added abc to the test.txt (tag: v1) [aku]
* 01b8702 2023-05-05 | Add first file (tag: v1-beta) [aku]第二种方式:使用操作系统命令操作
描述
命令
还需要注意
Last updated