git 培训
git 相关教程
http://cybdoc.uninote.com.cn/pub/learn/git.html
重写历史
commit --amend/rebase/reset
2 操作步骤:
- http://v.uninote.com.cn/video_play.html?video_url=https://admin.bb.uninote.com.cn/oss?path=video/upload/202110/20211004_170559.mp4
- http://v.uninote.com.cn/video_play.html?video_url=https://admin.bb.uninote.com.cn/oss?path=video/upload/202110/20211004_171437.mp4
3 tips:
- commit --amend 的本质就是 reset --soft, 再 commit
- 校验重写有无问题:比较两个最终节点的差异:http://v.uninote.com.cn/video_play.html?video_url=https://admin.bb.uninote.com.cn/oss?path=video/upload/202110/20211004_173406.mp4
节点合并
节点拆分
https://uninote.com.cn/book/1027/4324#C8BB303396
高级用法
git commit-tree
http://git-scm.com/docs/git-commit-tree
git commit-tree <tree> [(-p <parent>)…] < changelog git commit-tree [(-p <parent>)…] [-S[<keyid>]] [(-m <message>)…] [(-F <file>)…] <tree>
eg: git commit-tree tree_id -m "test message" git commit-tree tree_id -p p1 -p p2 -m message 成功会返回commit hash:
可以加个tag,就能访问了: git tag 123 efc74486233b4ed038f0abcd7a87bc0a08400e02
PS: 如何获取 tree? git cat-file -p <revision>