无论是开发、运维,还是测试,大家都知道Git在日常工作中的地位。所以,也是大家的必学、必备技能之一。之前公众号也发过很多git相关的文章:
然而,农民工兄弟经常在后台看到读者说,太多的订单很难记住,不用很久就忘了。是的,学习一项技术是很难的,更不用说这项技术更新和迭代得如此之快。
[En]
However, brother migrant workers often see readers in the background saying that it is difficult to remember too many orders, and that they do not have to forget them for a long time. Yes, it's hard to learn a technology, not to mention that the technology is updated and iterated so fast.
所以,对于学习Git这门技术,要是有一个一看就懂,一学就会的入门资料就好了。前不久,国外的一位小姐姐写了一篇这样的文章《CS Visualized: Useful Git Commands》。作者是来自英属哥伦比亚的小姐姐 Lydia Hallie,在这篇文章里面,她通过生动形象的动画,以更加直观的方式,向开发者展示 Git 命令中的 merge、rebase、reset、revert、cherry-pick 等常用骚操作的具体原理。
下面就给大家带来一些实例分享:
1、git merge
fast-forward模式
no-fast-forward模式
合并冲突修复的过程 ,动画演示如下:
2、git rebase
git rebase 指令会复制当前分支的所有最新提交,然后将这些提交添加到指定分支提交记录之上。