高级用法
子模块(Submodule)
bash
git submodule add <URL> <路径> # 添加子模块
git submodule update --init # 初始化子模块
git submodule update --remote # 更新子模块到最新版本交互式变基(Interactive Rebase)
bash
git rebase -i HEAD~3 # 交互式修改最近 3 个提交
# 在编辑器中选择操作:pick、reword、edit、squash、fixup合并冲突解决
bash
git merge <branch> # 发生冲突时
git status # 查看冲突文件
# 手动编辑冲突文件
git add <已解决文件>
git commit # 完成合并