Git十年十变化 #1
条件包含(IncludeIf)为不同目录下的仓库提供不同的默认设置 例如:不同目录下仓库提交使用不一样的邮箱配置(user.email)
git config --global "includeIf.gitdir:~/work-alibaba/.path" alibaba.inc
git config --global "includeIf.gitdir:~/work-oss/.path" oss.inc
Git十年十变化 #2
克隆操作对大仓库提供更好的支持
协议 2.0
git config protocol.version 2
稀疏检出
git clone --sparse …
git sparse-checkout <init | add | reapply> …
部分克隆
git clone --filter=blob:none …
Git十年十变化 #3
一个仓库可以拥有多个工作区(worktree),工作在一个仓库的不同分支上
创建新工作区
git worktree add -b topic-1 ../topic-1
如果切换至已检出到其他工作区的分支,报错
git switch topic-1
fatal: 'topic-1' is already checked out at ‘../topic-1’
清理工作区删除后,残存的Git管理文件
git worktree prune