小众GIT

2019-08-02  本文已影响0人  一只重拾梦想的小水

1、git reflog: 操作记录,找回reset等误操作

2、git rebase --todo

3、git submodule:

参考:https://codewinsarguments.co/2016/05/01/git-submodules-vs-git-subtrees/

a. 解决了什么问题
需要用到公共类库 library
类库特点:业务相关&公用
即有与业务代码一起开发的需要(为什么不用npm:npm包需要频繁发包更新版本),又要在多个项目中可共用

参考:http://www.ayqy.net/blog/%E7%90%86%E8%A7%A3git-submodules/

b. 对比subtree:

简而言之:
分开来讲:
Git commit sub(without push)
git commit&push super
// Clone repo: 
Git pull super
git submodule update
without push subproject
golden rule
Always commit and push the submodule changes first, before then committing the submodule change in the parent repository.
Tips:
If you define an alias which runs git submodule update after every single git pull then you will be safe, but a newbie is unlikely to do this.
上一篇下一篇

猜你喜欢

热点阅读