git添加,删除,修改与日志

删除

git rm xx–删除xx文件

  • 若想恢复被删除的文件,需要进行两个动作
    ** git reset HEAD xx 将删除的文件从暂存区恢复到工作区
    ** git checkout xx 将工作的中的修改丢弃掉
    git commit -m ‘delete test2.txt’ —提交删除日志

  • git mv —移动或者重命名

  • 在这里插入图片描述

  • git add .和git commit . ----将暂存区内所有文件操作

  • git commit --amend -m ‘修正提交消息’ —修正提交的消息
    在这里插入图片描述

  • git log --pretty=oneline —更加直观的提交日志

  • 在这里插入图片描述前面是提交id,后面是提交信息

  • git config help/man git config 查看帮助文档

猜你喜欢

转载自blog.csdn.net/qq_34788903/article/details/84553497