分类目录归档:Git

Git更安全的强制推送 -force-with-lease

Git 的 push --force 具有破坏性,因为它无条件地覆盖远程存储库,无论你在本地拥有什么。使用这个命令,可能覆盖团队成员在此期间推送的所有更改。然而,有一个更好的办法,当你需要强制推送,但仍需确保不覆盖其他人的工作时,-force-with-lease 这条指令选项可以帮助到你。


作者:LeviDing
链接:https://juejin.im/post/5985b9c56fb9a03c376de762
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

git子模块支持分支

You can set the submodule to track a particular branch (requires git 1.8.2+), which is what we are doing with Komodo, or you can reference a particular repository commit (the later requires updating the main repository whenever you want to pull in new changes from the module – i.e. updating the commit hash reference).

git submodule add -b master https://github.com/Komodo/trackchanges.git src/modules/trackchanges