Git的文件操作
========
命令
- git add [file1 file2 ...] 指定的文件添加到索引区
- git add . 添加全部文件到索引区
- git rm 删除未添加到索引区的文件
- git rm --cached 删除添加到索引区的文件
- git mv 文件的改名
代码
# 修改文件 创建 style.css
nano index.html nano style.css
# 添加文件到索引区
git add .
# 文件更名 index.html -> my.html
git mv index.html my.html
# 删除 style.css 已在索引区需要加上 --cached命令
git rm --cached style.css
网友评论