diff --git a/git-learn/git的学习笔记.md b/git-learn/git的学习笔记.md index d9c2750..145ec40 100644 --- a/git-learn/git的学习笔记.md +++ b/git-learn/git的学习笔记.md @@ -177,4 +177,24 @@ git push//推送到远程仓库 如果出现这个,不会发生文件的变化,一定有地方错了(比如忘记提交到版本库) -![image-20240427142157444](https://telegraph-image-5jy.pages.dev/file/96ec503cca5adf3bf977e.png) \ No newline at end of file +![image-20240427142157444](https://telegraph-image-5jy.pages.dev/file/96ec503cca5adf3bf977e.png) + +5. git rebase 删除commit的使用方法 + + 由于小组修改READEME.md出现过多的无用记录,尝试删除掉这些记录。 + + ![image-20240427233112146](https://telegraph-image-5jy.pages.dev/file/6ec2b192742861f292f51.png) + + (1)先git pull 拉取 + + (2)git rebase -i hash,hash是要保留的那一次的提交的值 + + (3)解决冲突就是把它冲突的地方删除掉,然后add,commit + + (4)解决冲突解决后git rebase --continue + + (5)git push到远程。 + + 成功删掉了一串无用且重复的README的更新消息 + + ![image-20240428000607940](https://telegraph-image-5jy.pages.dev/file/a6eb659aa96ae6b38f0c0.png) \ No newline at end of file