diff --git a/pages.zh/common/git-bulk.md b/pages.zh/common/git-bulk.md new file mode 100644 index 0000000000..bb7e45b8e6 --- /dev/null +++ b/pages.zh/common/git-bulk.md @@ -0,0 +1,37 @@ +# git bulk + +> 批量操作多个 Git 仓库。 +> 属于 `git-extras`的一部分。 +> 更多信息:. + +- 将当前目录注册为工作区: + +`git bulk --addcurrent {{工作区名称}}` + +- 注册一个工作区用于批量操作: + +`git bulk --addworkspace {{工作区名称}} {{到仓库的绝对路径}}` + +- 在指定目录克隆仓库并注册为工作区: + +`git bulk --addworkspace {{工作区名称}} {{仓库父目录的绝对路径}} --from {{远程仓库地址}}` + +- 从换行分隔的远程仓库列表克隆并注册为工作区: + +`git bulk --addworkspace {{工作区名称}} {{/路径/到/根/目录}} --from {{/路径/到/文件}}` + +- 列出所有已注册的工作区: + +`git bulk --listall` + +- 在当前工作区的所有仓库上执行 Git 命令: + +`git bulk {{命令}} {{命令参数}}` + +- 删除指定工作区: + +`git bulk --removeworkspace {{工作区名称}}` + +- 删除所有工作区: + +`git bulk --purge` diff --git a/pages.zh/common/git-bundle.md b/pages.zh/common/git-bundle.md new file mode 100644 index 0000000000..5e9cfd9818 --- /dev/null +++ b/pages.zh/common/git-bundle.md @@ -0,0 +1,36 @@ +# git bundle + +> 将对象和引用打包成归档文件。 +> 更多信息:. + +- 创建包含特定分支所有对象和引用的打包文件: + +`git bundle create {{路径/到/文件.bundle}} {{分支名}}` + +- 创建包含所有分支的打包文件: + +`git bundle create {{路径/到/文件.bundle}} --all` + +- 创建当前分支最近5次提交的打包文件: + +`git bundle create {{路径/到/文件.bundle}} -5 {{HEAD}}` + +- 创建最近7天提交的打包文件: + +`git bundle create {{路径/到/文件.bundle}} --since 7.days {{HEAD}}` + +- 验证打包文件是否有效且可应用到当前仓库: + +`git bundle verify {{路径/到/文件.bundle}}` + +- 显示打包文件中包含的引用列表: + +`git bundle unbundle {{路径/到/文件.bundle}}` + +- 从打包文件中解包特定分支到当前仓库: + +`git pull {{路径/到/文件.bundle}} {{分支名}}` + +- 从打包文件创建新仓库: + +`git clone {{路径/到/文件.bundle}}`