美文网首页
Git 06把握Git状态

Git 06把握Git状态

作者: 昵称啦啦啦 | 来源:发表于2018-11-23 12:00 被阅读0次

把握Git的状态

========

命令

  • git status 查看当前工作文件夹的状态
  • git checkout -- [file] 未添加到索引区 恢复上一个初始状态
  • git reset Head [file] 添加到索引区 退出索引区

代码

# 编辑index.html
nano index.html
# 查看文件状态
git status
# 取消改变 当文件添加到索引区使用该命令无效
git checkout index.html
# 当文件添加到索引区退出索引区使用 git reset HEAD [file]
git reset HEAD index.html
# 然后再执行  git checkout 就可回退成功
git checkout index.html

相关文章

网友评论

      本文标题:Git 06把握Git状态

      本文链接:https://www.haomeiwen.com/subject/mpqjqqtx.html