├── .nojekyll ├── CNAME ├── Dockerfile ├── update.sh ├── 404.html ├── asset ├── docsify-baidu-push.js ├── docsify-cnzz.js ├── docsify-baidu-stat.js ├── docsify-apachecn-footer.js ├── style.css ├── docsify-copy-code.min.js ├── prism-darcula.css └── search.min.js ├── docs ├── 83.md ├── 64.md ├── 69.md ├── 82.md ├── 72.md ├── 12.md ├── 52.md ├── 79.md ├── 60.md ├── 16.md ├── 66.md ├── 44.md ├── 55.md ├── 58.md ├── 4.md ├── 35.md ├── 11.md ├── 67.md ├── 81.md ├── 57.md ├── 29.md ├── 62.md ├── 43.md ├── 56.md ├── 68.md ├── 3.md ├── 78.md ├── 30.md ├── 61.md ├── 74.md ├── 32.md ├── 48.md ├── 24.md ├── 31.md ├── 73.md ├── 65.md ├── 18.md ├── 63.md ├── 47.md ├── 38.md ├── 19.md ├── 13.md └── 71.md ├── README.md ├── index.html ├── .gitignore ├── SUMMARY.md └── CONTRIBUTING.md /.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | git.apachecn.org -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM httpd:2.4 2 | COPY ./ /usr/local/apache2/htdocs/ -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | git add -A 2 | git commit -am "$(date "+%Y-%m-%d %H:%M:%S")" 3 | git push -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: /404.html 3 | --- 4 | 5 | -------------------------------------------------------------------------------- /asset/docsify-baidu-push.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var plugin = function(hook) { 3 | hook.doneEach(function() { 4 | new Image().src = 5 | '//api.share.baidu.com/s.gif?r=' + 6 | encodeURIComponent(document.referrer) + 7 | "&l=" + encodeURIComponent(location.href) 8 | }) 9 | } 10 | var plugins = window.$docsify.plugins || [] 11 | plugins.push(plugin) 12 | window.$docsify.plugins = plugins 13 | })() -------------------------------------------------------------------------------- /asset/docsify-cnzz.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var plugin = function(hook) { 3 | hook.doneEach(function() { 4 | var sc = document.createElement('script') 5 | sc.src = 'https://s5.cnzz.com/z_stat.php?id=' + 6 | window.$docsify.cnzzId + '&online=1&show=line' 7 | document.querySelector('article').appendChild(sc) 8 | }) 9 | } 10 | var plugins = window.$docsify.plugins || [] 11 | plugins.push(plugin) 12 | window.$docsify.plugins = plugins 13 | })() -------------------------------------------------------------------------------- /asset/docsify-baidu-stat.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var plugin = function(hook) { 3 | hook.doneEach(function() { 4 | window._hmt = window._hmt || [] 5 | var hm = document.createElement("script") 6 | hm.src = "https://hm.baidu.com/hm.js?" + window.$docsify.bdStatId 7 | document.querySelector("article").appendChild(hm) 8 | }) 9 | } 10 | var plugins = window.$docsify.plugins || [] 11 | plugins.push(plugin) 12 | window.$docsify.plugins = plugins 13 | })() -------------------------------------------------------------------------------- /docs/83.md: -------------------------------------------------------------------------------- 1 | # git-write-tree 2 | 3 | > 原文: [https://git-scm.com/docs/git-write-tree](https://git-scm.com/docs/git-write-tree) 4 | 5 | ## 名称 6 | 7 | git-write-tree - 从当前索引创建树对象 8 | 9 | ## 概要 10 | 11 | ``` 12 | git write-tree [--missing-ok] [--prefix=/] 13 | ``` 14 | 15 | ## 描述 16 | 17 | 使用当前索引创建树对象。新树对象的名称将打印到标准输出。 18 | 19 | 索引必须处于完全合并状态。 20 | 21 | 从概念上讲, _git write-tree_ sync()将当前索引内容转换为一组树文件。为了使你的目录中实际存在的匹配,你需要在 _git write-tree_ 之前完成 _git update-index_ 阶段。 22 | 23 | ## OPTIONS 24 | 25 | ``` 26 | --missing-ok 27 | ``` 28 | 29 | 通常 _git write-tree_ 确保目录引用的对象存在于对象数据库中。此选项禁用此检查。 30 | 31 | ``` 32 | --prefix=/ 33 | ``` 34 | 35 | 写一个表示子目录`<prefix>`的树对象。这可用于为命名子目录中的子项目编写树对象。 36 | 37 | ## GIT 38 | 39 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/64.md: -------------------------------------------------------------------------------- 1 | # git-update-server-info 2 | 3 | > 原文: [https://git-scm.com/docs/git-update-server-info](https://git-scm.com/docs/git-update-server-info) 4 | 5 | ## 名称 6 | 7 | git-update-server-info - 更新辅助信息文件以帮助虚拟服务器 8 | 9 | ## 概要 10 | 11 | ``` 12 | git update-server-info [--force] 13 | ``` 14 | 15 | ## 描述 16 | 17 | 没有动态包生成的哑服务器必须在$ GIT_DIR / info和$ GIT_OBJECT_DIRECTORY / info目录中包含一些辅助信息文件,以帮助客户端发现服务器具有哪些引用和包。此命令生成此类辅助文件。 18 | 19 | ## OPTIONS 20 | 21 | ``` 22 | -f 23 | ``` 24 | 25 | ``` 26 | --force 27 | ``` 28 | 29 | 从头开始更新信息文件。 30 | 31 | ## OUTPUT 32 | 33 | 目前,该命令会更新以下文件。请参阅 [gitrepository-layout [5]](https://git-scm.com/docs/gitrepository-layout) ,了解它们的用途: 34 | 35 | * 对象/信息/包 36 | 37 | * 信息/裁判 38 | 39 | ## GIT 40 | 41 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/69.md: -------------------------------------------------------------------------------- 1 | # git-count-objects 2 | 3 | > 原文: [https://git-scm.com/docs/git-count-objects](https://git-scm.com/docs/git-count-objects) 4 | 5 | ## 名称 6 | 7 | git-count-objects - 计算解压缩的对象数及其磁盘消耗 8 | 9 | ## 概要 10 | 11 | ``` 12 | git count-objects [-v] [-H | --human-readable] 13 | ``` 14 | 15 | ## 描述 16 | 17 | 这会计算解压缩的目标文件的数量和它们消耗的磁盘空间,以帮助您确定何时是重新打包的好时机。 18 | 19 | ## OPTIONS 20 | 21 | ``` 22 | -v 23 | ``` 24 | 25 | ``` 26 | --verbose 27 | ``` 28 | 29 | 报告更详细: 30 | 31 | count:松散物体的数量 32 | 33 | size:松散对象消耗的磁盘空间,以KiB为单位(除非指定了-H) 34 | 35 | in-pack:包内对象的数量 36 | 37 | size-pack:包消耗的磁盘空间,以KiB为单位(除非指定了-H) 38 | 39 | prune-packable:包中也存在的松散物体的数量。可以使用`git prune-packed`修剪这些对象。 40 | 41 | garbage:对象数据库中既不是有效的松散对象也不是有效包的文件数 42 | 43 | size-garbage:垃圾文件占用的磁盘空间,以KiB为单位(除非指定-H) 44 | 45 | alternate:备用对象数据库的绝对路径;可能会出现多次,每条路径一行。请注意,如果路径包含不可打印的字符,则它可能被双引号括起来并包含C样式的反斜杠转义序列。 46 | 47 | ``` 48 | -H 49 | ``` 50 | 51 | ``` 52 | --human-readable 53 | ``` 54 | 55 | 以人类可读格式打印尺寸 56 | 57 | ## GIT 58 | 59 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/82.md: -------------------------------------------------------------------------------- 1 | # git-verify-pack 2 | 3 | > 原文: [https://git-scm.com/docs/git-verify-pack](https://git-scm.com/docs/git-verify-pack) 4 | 5 | ## 名称 6 | 7 | git-verify-pack - 验证打包的Git存档文件 8 | 9 | ## 概要 10 | 11 | ``` 12 | git verify-pack [-v|--verbose] [-s|--stat-only] [--] .idx …​ 13 | ``` 14 | 15 | ## 描述 16 | 17 | 读取给定的idx文件,用于使用 _git pack-objects_ 命令创建的打包Git存档,并验证idx文件和相应的包文件。 18 | 19 | ## OPTIONS 20 | 21 | ``` 22 | .idx …​ 23 | ``` 24 | 25 | 要验证的idx文件。 26 | 27 | ``` 28 | -v 29 | ``` 30 | 31 | ``` 32 | --verbose 33 | ``` 34 | 35 | 验证包后,显示包中包含的对象列表和delta链长度的直方图。 36 | 37 | ``` 38 | -s 39 | ``` 40 | 41 | ``` 42 | --stat-only 43 | ``` 44 | 45 | 不要验证包装内容;仅显示三角链长度的直方图。使用`--verbose`,还会显示对象列表。 46 | 47 | ``` 48 | -- 49 | ``` 50 | 51 | 不要将任何更多的参数解释为选项。 52 | 53 | ## 输出格式 54 | 55 | 指定-v选项时,使用的格式为: 56 | 57 | ``` 58 | SHA-1 type size size-in-packfile offset-in-packfile 59 | ``` 60 | 61 | 对于未在包中进行分层的对象,以及 62 | 63 | ``` 64 | SHA-1 type size size-in-packfile offset-in-packfile depth base-SHA-1 65 | ``` 66 | 67 | 对于已经完成的对象。 68 | 69 | ## GIT 70 | 71 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/72.md: -------------------------------------------------------------------------------- 1 | # git-hash-object 2 | 3 | > 原文: [https://git-scm.com/docs/git-hash-object](https://git-scm.com/docs/git-hash-object) 4 | 5 | ## 名称 6 | 7 | git-hash-object - 计算对象ID,并可选择从文件创建blob 8 | 9 | ## 概要 10 | 11 | ``` 12 | git hash-object [-t ] [-w] [--path=|--no-filters] [--stdin [--literally]] [--] …​ 13 | git hash-object [-t ] [-w] --stdin-paths [--no-filters] 14 | ``` 15 | 16 | ## 描述 17 | 18 | 使用指定文件的内容(可以在工作树之外)计算具有指定类型的对象的对象ID值,并可选择将结果对象写入对象数据库。将其对象ID报告给其标准输出。 _git cvsimport_ 使用它来更新索引而不修改工作树中的文件。当< type>未指定,默认为“blob”。 19 | 20 | ## OPTIONS 21 | 22 | ``` 23 | -t 24 | ``` 25 | 26 | 指定类型(默认值:“blob”)。 27 | 28 | ``` 29 | -w 30 | ``` 31 | 32 | 实际上将对象写入对象数据库。 33 | 34 | ``` 35 | --stdin 36 | ``` 37 | 38 | 从标准输入而不是从文件中读取对象。 39 | 40 | ``` 41 | --stdin-paths 42 | ``` 43 | 44 | 从标准输入读取文件名,每行一个,而不是从命令行读取。 45 | 46 | ``` 47 | --path 48 | ``` 49 | 50 | 哈希对象,因为它位于给定的路径。文件的位置不会直接影响哈希值,但路径用于确定在将对象放置到对象数据库之前应该将哪些Git过滤器应用于对象,并且,作为应用过滤器的结果,实际的blob放置进入对象数据库可能与给定文件不同。此选项主要用于散列位于工作目录外部的临时文件或从stdin读取的文件。 51 | 52 | ``` 53 | --no-filters 54 | ``` 55 | 56 | 按原样哈希内容,忽略属性机制选择的任何输入过滤器,包括行尾转换。如果从标准输入读取文件,则始终隐含,除非给出`--path`选项。 57 | 58 | ``` 59 | --literally 60 | ``` 61 | 62 | 允许`--stdin`将任何垃圾散列到松散的对象中,否则可能无法通过标准对象解析或git-fsck检查。用于压力测试Git本身或复制野外遇到的腐败或伪造物体的特征。 63 | 64 | ## GIT 65 | 66 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/12.md: -------------------------------------------------------------------------------- 1 | # git-mv 2 | 3 | > 原文: [https://git-scm.com/docs/git-mv](https://git-scm.com/docs/git-mv) 4 | 5 | ## 名称 6 | 7 | git-mv - 移动或重命名文件,目录或符号链接 8 | 9 | ## 概要 10 | 11 | ``` 12 | git mv …​ …​ 13 | ``` 14 | 15 | ## 描述 16 | 17 | 移动或重命名文件,目录或符号链接。 18 | 19 | ``` 20 | git mv [-v] [-f] [-n] [-k] 21 | git mv [-v] [-f] [-n] [-k] ... 22 | ``` 23 | 24 | 在第一种形式中,它将重命名为必须存在,并且可以是文件,符号链接或目录。在第二种形式中,最后一个参数必须是现有目录;给定的源将被移动到此目录中。 25 | 26 | 成功完成后会更新索引,但仍必须提交更改。 27 | 28 | ## 选项 29 | 30 | ``` 31 | -f 32 | ``` 33 | 34 | ``` 35 | --force 36 | ``` 37 | 38 | 即使目标存在,也强制重命名或移动文件 39 | 40 | ``` 41 | -k 42 | ``` 43 | 44 | 跳过移动或重命名可能导致错误情况的操作。当源既不存在也不由Git控制时,将发生错误,或者除非给出`-f`,覆盖现有文件时也会发生错误。 45 | 46 | ``` 47 | -n 48 | ``` 49 | 50 | ``` 51 | --dry-run 52 | ``` 53 | 54 | 没做什么;只显示会发生什么 55 | 56 | ``` 57 | -v 58 | ``` 59 | 60 | ``` 61 | --verbose 62 | ``` 63 | 64 | 在移动文件时报告文件的名称。 65 | 66 | ## 子模 67 | 68 | 使用gitfile移动子模块(这意味着它们使用Git 1.7.8或更高版本克隆)将更新gitfile和core.worktree设置以使子模块在新位置工作。它还将尝试更新 [gitmodules [5]](https://git-scm.com/docs/gitmodules) 文件中的子模块.path设置并暂存该文件(除非使用-n)。 69 | 70 | ## BUGS 71 | 72 | 每次超级项目更新移动填充的子模块时(例如,当在移动之前和之后切换提交时),旧的子模块检出将保留在旧位置,并且空目录将出现在新位置。要在新位置再次填充子模块,用户必须在之后运行“git submodule update”。删除旧目录只有在使用gitfile时才是安全的,否则子模块的历史记录也将被删除。当实现递归子模块更新时,这两个步骤都将过时。 73 | 74 | ## GIT 75 | 76 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/52.md: -------------------------------------------------------------------------------- 1 | # git-request-pull 2 | 3 | > 原文: [https://git-scm.com/docs/git-request-pull](https://git-scm.com/docs/git-request-pull) 4 | 5 | ## 名称 6 | 7 | git-request-pull - 生成挂起更改的摘要 8 | 9 | ## 概要 10 | 11 | ``` 12 | git request-pull [-p] [] 13 | ``` 14 | 15 | ## 描述 16 | 17 | 生成一个请求,要求您的上游项目将更改提取到其树中。打印到标准输出的请求从分支描述开始,总结了更改并指示它们可以从哪里拉出。 18 | 19 | 上游项目应该具有`<start>`命名的提交,并且输出要求它通过访问由`<url>`命名的存储库来集成自提交以来所做的更改,直到`<end>`命名的提交。 20 | 21 | ## OPTIONS 22 | 23 | ``` 24 | -p 25 | ``` 26 | 27 | 在输出中包含补丁文本。 28 | 29 | ``` 30 | 31 | ``` 32 | 33 | 承诺开始。这将命名已在上游历史记录中的提交。 34 | 35 | ``` 36 | 37 | ``` 38 | 39 | 要从中提取的存储库URL。 40 | 41 | ``` 42 | 43 | ``` 44 | 45 | 承诺结束于(默认为HEAD)。这会在您要求提取的历史记录的末尾命名提交。 46 | 47 | 当`<url>`命名的存储库在ref的一端提交与本地的ref不同时,可以使用`<local>:<remote>`语法,使其本地名称为冒号`:`,并且远程名称。 48 | 49 | ## 例子 50 | 51 | 想象一下,您在`v1.0`版本之上的`master`分支上构建了您的工作,并希望将其集成到项目中。首先,您将该更改推送到您的公共存储库,供其他人查看: 52 | 53 | ``` 54 | git push https://git.ko.xz/project master 55 | ``` 56 | 57 | 然后,运行以下命令: 58 | 59 | ``` 60 | git request-pull v1.0 https://git.ko.xz/project master 61 | ``` 62 | 63 | 它将向上游发出请求,总结`v1.0`版本和`master`之间的变化,从公共存储库中提取它。 64 | 65 | 如果您将更改推送到名称与本地名称不同的分支,例如 66 | 67 | ``` 68 | git push https://git.ko.xz/project master:for-linus 69 | ``` 70 | 71 | 然后你可以要求被拉 72 | 73 | ``` 74 | git request-pull v1.0 https://git.ko.xz/project master:for-linus 75 | ``` 76 | 77 | ## GIT 78 | 79 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/79.md: -------------------------------------------------------------------------------- 1 | # git-symbolic-ref 2 | 3 | > 原文: [https://git-scm.com/docs/git-symbolic-ref](https://git-scm.com/docs/git-symbolic-ref) 4 | 5 | ## 名称 6 | 7 | git-symbolic-ref - 读取,修改和删除符号引用 8 | 9 | ## 概要 10 | 11 | ``` 12 | git symbolic-ref [-m ] 13 | git symbolic-ref [-q] [--short] 14 | git symbolic-ref --delete [-q] 15 | ``` 16 | 17 | ## 描述 18 | 19 | 给定一个参数,读取给定符号ref的哪个分支头指向并输出其相对于`.git/`目录的路径。通常,您会将`HEAD`作为< name>查看工作树所在分支的参数。 20 | 21 | 给定两个参数,创建或更新符号引用< name>指向给定分支< ref>。 22 | 23 | 给定`--delete`和另一个参数,删除给定的符号引用。 24 | 25 | 符号引用是一个常规文件,用于存储以`ref: refs/`开头的字符串。例如,您的`.git/HEAD`是一个常规文件,其内容为`ref: refs/heads/master`。 26 | 27 | ## OPTIONS 28 | 29 | ``` 30 | -d 31 | ``` 32 | 33 | ``` 34 | --delete 35 | ``` 36 | 37 | 删除符号ref< name>。 38 | 39 | ``` 40 | -q 41 | ``` 42 | 43 | ``` 44 | --quiet 45 | ``` 46 | 47 | 如果< name&gt ;,请不要发出错误消息不是一个象征性的参考,而是一个独立的HEAD;而是以静默方式退出非零状态。 48 | 49 | ``` 50 | --short 51 | ``` 52 | 53 | 显示< name>的值时作为一个象征性的参考,试图缩短价值,例如从`refs/heads/master`到`master`。 54 | 55 | ``` 56 | -m 57 | ``` 58 | 59 | 更新< name>的reflog与< reason>。这仅在创建或更新符号引用时有效。 60 | 61 | ## 笔记 62 | 63 | 在过去,`.git/HEAD`是指向`refs/heads/master`的符号链接。当我们想切换到另一个分支时,我们做了`ln -sf refs/heads/newbranch .git/HEAD`,当我们想知道我们在哪个分支时,我们做了`readlink .git/HEAD`。但是符号链接不是完全可移植的,因此它们现在已被弃用,并且默认情况下使用符号引用(如上所述)。 64 | 65 | 如果符号引用的内容被正确打印,则 _git symbolic-ref_ 将以状态0退出,如果请求的名称不是符号引用,则状态为1;如果发生另一个错误,则为128。 66 | 67 | ## GIT 68 | 69 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Git 中文参考 2 | 3 | ![](https://git-scm.com/images/logo@2x.png) 4 | 5 | > 原文:[Git Reference](https://git-scm.com/docs) 6 | > 7 | > 协议:[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/) 8 | > 9 | > 技术标准就是纸。我每天都用纸擦屁股。这就是这些纸的价值所在。——林纳斯·托瓦兹 10 | 11 | * [在线阅读](https://apachecn.github.io/git-doc-zh) 12 | * [在线阅读(Gitee)](https://apachecn.gitee.io/git-doc-zh/) 13 | * [ApacheCN 面试求职交流群 724187166](https://jq.qq.com/?_wv=1027&k=54ujcL3) 14 | * [ApacheCN 学习资源](http://www.apachecn.org/) 15 | 16 | ## 下载 17 | 18 | ### Docker 19 | 20 | ``` 21 | docker pull apachecn0/git-doc-zh 22 | docker run -tid -p :80 apachecn0/git-doc-zh 23 | # 访问 http://localhost:{port} 查看文档 24 | ``` 25 | 26 | ### PYPI 27 | 28 | ``` 29 | pip install git-doc-zh 30 | git-doc-zh 31 | # 访问 http://localhost:{port} 查看文档 32 | ``` 33 | 34 | ### NPM 35 | 36 | ``` 37 | npm install -g git-doc-zh 38 | git-doc-zh 39 | # 访问 http://localhost:{port} 查看文档 40 | ``` 41 | 42 | ## 贡献指南 43 | 44 | 项目当前处于校对阶段,请查看[贡献指南](CONTRIBUTING.md),并在[整体进度](https://github.com/apachecn/git-doc-zh/issues/1)中领取任务。 45 | 46 | > 请您勇敢地去翻译和改进翻译。虽然我们追求卓越,但我们并不要求您做到十全十美,因此请不要担心因为翻译上犯错——在大部分情况下,我们的服务器已经记录所有的翻译,因此您不必担心会因为您的失误遭到无法挽回的破坏。(改编自维基百科) 47 | 48 | ## 联系方式 49 | 50 | ### 负责人 51 | 52 | * [飞龙](https://github.com/wizardforcel): 562826179 53 | 54 | ### 其他 55 | 56 | * 认领翻译和项目进度-地址: 57 | * 在我们的 [apachecn/git-doc-zh](https://github.com/apachecn/git-doc-zh) github 上提 issue. 58 | * 发邮件到 Email: `apachecn@163.com`. 59 | * 在我们的 [组织学习交流群](http://www.apachecn.org/organization/348.html) 中联系群主/管理员即可. 60 | 61 | ## 赞助我们 62 | 63 | ![](http://data.apachecn.org/img/about/donate.jpg) 64 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
now loading...
21 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | .DS_Store 103 | 104 | # gitbook 105 | _book 106 | 107 | # node.js 108 | node_modules 109 | 110 | # windows 111 | Thumbs.db 112 | 113 | # word 114 | ~$*.docx 115 | ~$*.doc 116 | -------------------------------------------------------------------------------- /asset/docsify-apachecn-footer.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var footer = [ 3 | '
', 4 | '
', 5 | '

我们一直在努力

', 6 | '

apachecn/git-doc-zh

', 7 | '

', 8 | ' ', 9 | ' ', 10 | ' ML | ApacheCN

', 11 | '

', 12 | '
', 13 | ' ', 17 | '
', 18 | '
' 19 | ].join('\n') 20 | var plugin = function(hook) { 21 | hook.afterEach(function(html) { 22 | return html + footer 23 | }) 24 | hook.doneEach(function() { 25 | (adsbygoogle = window.adsbygoogle || []).push({}) 26 | }) 27 | } 28 | var plugins = window.$docsify.plugins || [] 29 | plugins.push(plugin) 30 | window.$docsify.plugins = plugins 31 | })() -------------------------------------------------------------------------------- /docs/60.md: -------------------------------------------------------------------------------- 1 | # git-instaweb 2 | 3 | > 原文: [https://git-scm.com/docs/git-instaweb](https://git-scm.com/docs/git-instaweb) 4 | 5 | ## 名称 6 | 7 | git-instaweb - 立即在gitweb中浏览您的工作存储库 8 | 9 | ## 概要 10 | 11 | ``` 12 | git instaweb [--local] [--httpd=] [--port=] 13 | [--browser=] 14 | git instaweb [--start] [--stop] [--restart] 15 | ``` 16 | 17 | ## 描述 18 | 19 | 设置`gitweb`的简单脚本和用于浏览本地存储库的Web服务器。 20 | 21 | ## OPTIONS 22 | 23 | ``` 24 | -l 25 | ``` 26 | 27 | ``` 28 | --local 29 | ``` 30 | 31 | 仅将Web服务器绑定到本地IP(127.0.0.1)。 32 | 33 | ``` 34 | -d 35 | ``` 36 | 37 | ``` 38 | --httpd 39 | ``` 40 | 41 | 将执行的HTTP守护程序命令行。这里可以指定命令行选项,配置文件将添加到命令行的末尾。目前支持apache2,lighttpd,mongoose,plackup,python和webrick。 (默认值:lighttpd) 42 | 43 | ``` 44 | -m 45 | ``` 46 | 47 | ``` 48 | --module-path 49 | ``` 50 | 51 | 模块路径(仅当httpd是Apache时才需要)。 (默认值:/ usr / lib / apache2 / modules) 52 | 53 | ``` 54 | -p 55 | ``` 56 | 57 | ``` 58 | --port 59 | ``` 60 | 61 | 要将httpd绑定到的端口号。 (默认值:1234) 62 | 63 | ``` 64 | -b 65 | ``` 66 | 67 | ``` 68 | --browser 69 | ``` 70 | 71 | 应该用于查看gitweb页面的Web浏览器。这将被传递到 _git web {litdd}浏览_帮助程序脚本以及gitweb实例的URL。有关详细信息,请参阅 [git-web {litdd}浏览[1]](https://git-scm.com/docs/git-web{litdd}browse) 。如果脚本失败,则URL将打印到stdout。 72 | 73 | ``` 74 | start 75 | ``` 76 | 77 | ``` 78 | --start 79 | ``` 80 | 81 | 启动httpd实例并退出。根据需要重新生成配置文件以生成新实例。 82 | 83 | ``` 84 | stop 85 | ``` 86 | 87 | ``` 88 | --stop 89 | ``` 90 | 91 | 停止httpd实例并退出。这不会生成任何用于生成新实例的配置文件,也不会关闭浏览器。 92 | 93 | ``` 94 | restart 95 | ``` 96 | 97 | ``` 98 | --restart 99 | ``` 100 | 101 | 重新启动httpd实例并退出。根据需要重新生成配置文件以生成新实例。 102 | 103 | ## 组态 104 | 105 | 您可以在.git / config中指定配置 106 | 107 | ``` 108 | [instaweb] 109 | local = true 110 | httpd = apache2 -f 111 | port = 4321 112 | browser = konqueror 113 | modulePath = /usr/lib/apache2/modules 114 | ``` 115 | 116 | 如果未设置配置变量`instaweb.browser`,则在定义时将使用`web.browser`。有关详细信息,请参阅 [git-web {litdd}浏览[1]](https://git-scm.com/docs/git-web{litdd}browse) 。 117 | 118 | ## 也可以看看 119 | 120 | [gitweb [1]](https://git-scm.com/docs/gitweb) 121 | 122 | ## GIT 123 | 124 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /asset/style.css: -------------------------------------------------------------------------------- 1 | /*隐藏头部的目录*/ 2 | #main>ul:nth-child(1) { 3 | display: none; 4 | } 5 | 6 | #main>ul:nth-child(2) { 7 | display: none; 8 | } 9 | 10 | .markdown-section h1 { 11 | margin: 3rem 0 2rem 0; 12 | } 13 | 14 | .markdown-section h2 { 15 | margin: 2rem 0 1rem; 16 | } 17 | 18 | img, 19 | pre { 20 | border-radius: 8px; 21 | } 22 | 23 | .content, 24 | .sidebar, 25 | .markdown-section, 26 | body, 27 | .search input { 28 | background-color: rgba(243, 242, 238, 1) !important; 29 | } 30 | 31 | @media (min-width:600px) { 32 | .sidebar-toggle { 33 | background-color: #f3f2ee; 34 | } 35 | } 36 | 37 | .docsify-copy-code-button { 38 | background: #f8f8f8 !important; 39 | color: #7a7a7a !important; 40 | } 41 | 42 | body { 43 | /*font-family: Microsoft YaHei, Source Sans Pro, Helvetica Neue, Arial, sans-serif !important;*/ 44 | } 45 | 46 | .markdown-section>p { 47 | font-size: 16px !important; 48 | } 49 | 50 | .markdown-section pre>code { 51 | font-family: Consolas, Roboto Mono, Monaco, courier, monospace !important; 52 | font-size: .9rem !important; 53 | 54 | } 55 | 56 | /*.anchor span { 57 | color: rgb(66, 185, 131); 58 | }*/ 59 | 60 | section.cover h1 { 61 | margin: 0; 62 | } 63 | 64 | body>section>div.cover-main>ul>li>a { 65 | color: #42b983; 66 | } 67 | 68 | .markdown-section img { 69 | box-shadow: 7px 9px 10px #aaa !important; 70 | } 71 | 72 | 73 | pre { 74 | background-color: #f3f2ee !important; 75 | } 76 | 77 | @media (min-width:600px) { 78 | pre code { 79 | /*box-shadow: 2px 1px 20px 2px #aaa;*/ 80 | /*border-radius: 10px !important;*/ 81 | padding-left: 20px !important; 82 | } 83 | } 84 | 85 | @media (max-width:600px) { 86 | pre { 87 | padding-left: 0px !important; 88 | padding-right: 0px !important; 89 | } 90 | } 91 | 92 | .markdown-section pre { 93 | padding-left: 0 !important; 94 | padding-right: 0px !important; 95 | box-shadow: 2px 1px 20px 2px #aaa; 96 | } -------------------------------------------------------------------------------- /docs/16.md: -------------------------------------------------------------------------------- 1 | # git-mergetool 2 | 3 | > 原文: [https://git-scm.com/docs/git-mergetool](https://git-scm.com/docs/git-mergetool) 4 | 5 | ## 名称 6 | 7 | git-mergetool - 运行合并冲突解决工具来解决合并冲突 8 | 9 | ## 概要 10 | 11 | ``` 12 | git mergetool [--tool=] [-y | --[no-]prompt] […​] 13 | ``` 14 | 15 | ## 描述 16 | 17 | 使用`git mergetool`运行多个合并实用程序之一来解决合并冲突。它通常在 _git merge_ 之后运行。 18 | 19 | 如果一个或多个< file>给出参数,将运行合并工具程序以解决每个文件的差异(跳过那些没有冲突的文件)。指定目录将包括该路径中的所有未解析文件。如果没有< file>如果指定了名称, _git mergetool_ 将在每个具有合并冲突的文件上运行合并工具程序。 20 | 21 | ## OPTIONS 22 | 23 | ``` 24 | -t 25 | ``` 26 | 27 | ``` 28 | --tool= 29 | ``` 30 | 31 | 使用< tool>指定的合并解析程序。有效值包括emerge,gvimdiff,kdiff3,meld,vimdiff和tortoisemerge。运行`git mergetool --tool-help`以获取有效< tool>的列表设置。 32 | 33 | 如果未指定合并解析程序, _git mergetool_ 将使用配置变量`merge.tool`。如果未设置配置变量`merge.tool`, _git mergetool_ 将选择合适的默认值。 34 | 35 | 您可以通过设置配置变量`mergetool.<tool>.path`显式提供工具的完整路径。例如,您可以通过设置`mergetool.kdiff3.path`配置kdiff3的绝对路径。否则, _git mergetool_ 假定该工具在PATH中可用。 36 | 37 | 可以通过指定要在配置变量`mergetool.<tool>.cmd`中调用的命令行来自定义 _git mergetool_ 来运行备用程序,而不是运行其中一个已知的合并工具程序。 38 | 39 | 当使用此工具调用 _git mergetool_ 时(通过`-t`或`--tool`选项或`merge.tool`配置变量),将在`$BASE`设置为名称的情况下调用配置的命令行包含合并公共基础的临时文件(如果有); `$LOCAL`设置为包含当前分支上文件内容的临时文件的名称; `$REMOTE`设置为包含要合并的文件内容的临时文件的名称,`$MERGED`设置为合并工具应写入合并解析结果的文件的名称。 40 | 41 | 如果自定义合并工具正确指示合并解析及其退出代码成功,则配置变量`mergetool.<tool>.trustExitCode`可以设置为`true`。否则, _git mergetool_ 将提示用户在自定义工具退出后指示分辨率是否成功。 42 | 43 | ``` 44 | --tool-help 45 | ``` 46 | 47 | 打印可能与`--tool`一起使用的合并工具列表。 48 | 49 | ``` 50 | -y 51 | ``` 52 | 53 | ``` 54 | --no-prompt 55 | ``` 56 | 57 | 在每次调用合并解析程序之前不要提示。如果使用`--tool`选项或`merge.tool`配置变量显式指定了合并解析程序,则这是默认值。 58 | 59 | ``` 60 | --prompt 61 | ``` 62 | 63 | 在每次调用合并解析程序之前提示,以便为用户提供跳过路径的机会。 64 | 65 | ``` 66 | -g 67 | ``` 68 | 69 | ``` 70 | --gui 71 | ``` 72 | 73 | 当使用`-g`或`--gui`选项调用 _git-mergetool_ 时,将从配置的`merge.guitool`变量而不是`merge.tool`中读取默认合并工具。 74 | 75 | ``` 76 | --no-gui 77 | ``` 78 | 79 | 这将覆盖先前的`-g`或`--gui`设置,并且将从配置的`merge.tool`变量中读取默认合并工具。 80 | 81 | ``` 82 | -O 83 | ``` 84 | 85 | 按照< orderfile>中指定的顺序处理文件,每行有一个shell glob模式。这会覆盖`diff.orderFile`配置变量(参见 [git-config [1]](https://git-scm.com/docs/git-config) )。要取消`diff.orderFile`,请使用`-O/dev/null`。 86 | 87 | ## 临时文件 88 | 89 | `git mergetool`在解析合并时创建`*.orig`备份文件。一旦文件合并并且其`git mergetool`会话已完成,可以安全地删除它们。 90 | 91 | 将`mergetool.keepBackup`配置变量设置为`false`会导致`git mergetool`在文件成功合并时自动删除备份。 92 | 93 | ## GIT 94 | 95 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/66.md: -------------------------------------------------------------------------------- 1 | # git-check-ignore 2 | 3 | > 原文: [https://git-scm.com/docs/git-check-ignore](https://git-scm.com/docs/git-check-ignore) 4 | 5 | ## 名称 6 | 7 | git-check-ignore - 调试gitignore / exclude文件 8 | 9 | ## 概要 10 | 11 | ``` 12 | git check-ignore [] …​ 13 | git check-ignore [] --stdin 14 | ``` 15 | 16 | ## 描述 17 | 18 | 对于通过命令行或通过`--stdin`从文件给出的每个路径名,检查文件是否被.gitignore(或排除机制的其他输入文件)排除,并输出路径(如果它被排除)。 19 | 20 | 默认情况下,跟踪文件根本不显示,因为它们不受排除规则的约束;但请参阅'--no-index'。 21 | 22 | ## OPTIONS 23 | 24 | ``` 25 | -q, --quiet 26 | ``` 27 | 28 | 不要输出任何内容,只需设置退出状态即可。这仅对单个路径名有效。 29 | 30 | ``` 31 | -v, --verbose 32 | ``` 33 | 34 | 还输出有关每个给定路径名的匹配模式(如果有)的详细信息。有关排除源内和排除源之间的优先级规则,请参阅 [gitignore [5]](https://git-scm.com/docs/gitignore) 。 35 | 36 | ``` 37 | --stdin 38 | ``` 39 | 40 | 从标准输入读取路径名,每行一个,而不是命令行。 41 | 42 | ``` 43 | -z 44 | ``` 45 | 46 | 输出格式被修改为可机器解析(见下文)。如果还给出`--stdin`,则输入路径用NUL字符而不是换行符分隔。 47 | 48 | ``` 49 | -n, --non-matching 50 | ``` 51 | 52 | 显示与任何模式都不匹配的给定路径。这仅在启用`--verbose`时才有意义,否则将无法区分匹配模式的路径和不匹配模式的路径。 53 | 54 | ``` 55 | --no-index 56 | ``` 57 | 58 | 在进行检查时不要查看索引。这可以用于调试由例如跟踪路径的原因。 `git add .`并且未被用户预期的规则忽略,或者在开发包含否定的模式以匹配先前使用`git add -f`添加的路径时。 59 | 60 | ## OUTPUT 61 | 62 | 默认情况下,将输出与忽略模式匹配的任何给定路径名,每行一个。如果没有模式匹配给定路径,则不会为该路径输出任何内容;这意味着路径不会被忽略。 63 | 64 | 如果指定了`--verbose`,则输出是以下形式的一系列行: 65 | 66 | <信源> <结肠癌和GT; < LINENUM> <结肠癌和GT; <模式> < HT> <路径名> 67 | 68 | <路径名>是要查询的文件的路径,< pattern>是匹配模式,< source>是模式的源文件,< linenum>是该源中模式的行号。如果模式包含`!`前缀或`/`后缀,则它将保留在输出中。 <信源>在引用`core.excludesFile`配置的文件时,或者在引用`.git/info/exclude`或每个目录的排除文件时相对于存储库根目录时,它将是绝对路径。 69 | 70 | 如果指定了`-z`,则输出中的路径名由空字符分隔;如果还指定了`--verbose`,则还使用空字符代替冒号和硬标签: 71 | 72 | <信源> < NULL> < LINENUM> < NULL> <模式> < NULL> <路径名> < NULL> 73 | 74 | 如果指定了`-n`或`--non-matching`,则还将输出不匹配的路径名,在这种情况下,每个输出记录中的所有字段除了< pathname>将是空的。这在非交互式运行时非常有用,因此可以将文件递增地流式传输到长时间运行的检查忽略过程的STDIN,并且对于每个文件,STDOUT将指示该文件是否与模式匹配。 (如果没有这个选项,就不可能判断给定文件的输出是否缺少意味着它是否与任何模式不匹配,或者输出是否尚未生成。) 75 | 76 | 缓冲发生在 [git [1]](https://git-scm.com/docs/git) 的`GIT_FLUSH`选项中。调用者负责避免因输入缓冲区过满或从空输出缓冲区读取而导致的死锁。 77 | 78 | ## 退出状态 79 | 80 | ``` 81 | 0 82 | ``` 83 | 84 | 忽略一个或多个提供的路径。 85 | 86 | ``` 87 | 1 88 | ``` 89 | 90 | 没有提供的路径被忽略。 91 | 92 | ``` 93 | 128 94 | ``` 95 | 96 | 遇到致命错误。 97 | 98 | ## 也可以看看 99 | 100 | [gitignore [5]](https://git-scm.com/docs/gitignore) [git-config [1]](https://git-scm.com/docs/git-config) [git-ls-files [1]](https://git-scm.com/docs/git-ls-files) 101 | 102 | ## GIT 103 | 104 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | + [git](docs/1.md) 2 | + [git-config](docs/2.md) 3 | + [git-help](docs/3.md) 4 | + [git-init](docs/4.md) 5 | + [git-clone](docs/5.md) 6 | + [git-add](docs/6.md) 7 | + [git-status](docs/7.md) 8 | + [git-diff](docs/8.md) 9 | + [git-commit](docs/9.md) 10 | + [git-reset](docs/10.md) 11 | + [git-rm](docs/11.md) 12 | + [git-mv](docs/12.md) 13 | + [git-branch](docs/13.md) 14 | + [git-checkout](docs/14.md) 15 | + [git-merge](docs/15.md) 16 | + [git-mergetool](docs/16.md) 17 | + [git-log](docs/17.md) 18 | + [git-stash](docs/18.md) 19 | + [git-tag](docs/19.md) 20 | + [git-worktree](docs/20.md) 21 | + [git-fetch](docs/21.md) 22 | + [git-pull](docs/22.md) 23 | + [git-push](docs/23.md) 24 | + [git-remote](docs/24.md) 25 | + [git-submodule](docs/25.md) 26 | + [git-show](docs/26.md) 27 | + [git-log](docs/27.md) 28 | + [git-shortlog](docs/29.md) 29 | + [git-describe](docs/30.md) 30 | + [git-apply](docs/31.md) 31 | + [git-cherry-pick](docs/32.md) 32 | + [git-rebase](docs/34.md) 33 | + [git-revert](docs/35.md) 34 | + [git-bisect](docs/36.md) 35 | + [git-blame](docs/37.md) 36 | + [git-grep](docs/38.md) 37 | + [gitattributes](docs/39.md) 38 | + [giteveryday](docs/40.md) 39 | + [gitglossary](docs/41.md) 40 | + [githooks](docs/42.md) 41 | + [gitignore](docs/43.md) 42 | + [gitmodules](docs/44.md) 43 | + [gitrevisions](docs/45.md) 44 | + [gittutorial](docs/46.md) 45 | + [gitworkflows](docs/47.md) 46 | + [git-am](docs/48.md) 47 | + [git-format-patch](docs/50.md) 48 | + [git-send-email](docs/51.md) 49 | + [git-request-pull](docs/52.md) 50 | + [git-svn](docs/53.md) 51 | + [git-fast-import](docs/54.md) 52 | + [git-clean](docs/55.md) 53 | + [git-gc](docs/56.md) 54 | + [git-fsck](docs/57.md) 55 | + [git-reflog](docs/58.md) 56 | + [git-filter-branch](docs/59.md) 57 | + [git-instaweb](docs/60.md) 58 | + [git-archive](docs/61.md) 59 | + [git-bundle](docs/62.md) 60 | + [git-daemon](docs/63.md) 61 | + [git-update-server-info](docs/64.md) 62 | + [git-cat-file](docs/65.md) 63 | + [git-check-ignore](docs/66.md) 64 | + [git-checkout-index](docs/67.md) 65 | + [git-commit-tree](docs/68.md) 66 | + [git-count-objects](docs/69.md) 67 | + [git-diff-index](docs/70.md) 68 | + [git-for-each-ref](docs/71.md) 69 | + [git-hash-object](docs/72.md) 70 | + [git-ls-files](docs/73.md) 71 | + [git-merge-base](docs/74.md) 72 | + [git-read-tree](docs/75.md) 73 | + [git-rev-list](docs/76.md) 74 | + [git-rev-parse](docs/77.md) 75 | + [git-show-ref](docs/78.md) 76 | + [git-symbolic-ref](docs/79.md) 77 | + [git-update-index](docs/80.md) 78 | + [git-update-ref](docs/81.md) 79 | + [git-verify-pack](docs/82.md) 80 | + [git-write-tree](docs/83.md) 81 | -------------------------------------------------------------------------------- /docs/44.md: -------------------------------------------------------------------------------- 1 | # gitmodules 2 | 3 | > 原文: [https://git-scm.com/docs/gitmodules](https://git-scm.com/docs/gitmodules) 4 | 5 | ## 名称 6 | 7 | gitmodules - 定义子模块属性 8 | 9 | ## 概要 10 | 11 | $ GIT_WORK_DIR / .gitmodules 12 | 13 | ## 描述 14 | 15 | `.gitmodules`文件位于Git工作树的顶级目录中,是一个文本文件,其语法与 [git-config [1]](https://git-scm.com/docs/git-config) 的要求相匹配。 16 | 17 | 该文件包含每个子模块的一个子部分,子部分值是子模块的名称。该名称设置为添加子模块的路径,除非使用 _git子模块添加_的`--name`选项进行自定义。每个子模块部分还包含以下必需的键: 18 | 19 | ``` 20 | submodule..path 21 | ``` 22 | 23 | 定义相对于Git工作树的顶级目录的路径,其中预期子模块将被检出。路径名称不得以`/`结尾。所有子模块路径在.gitmodules文件中必须是唯一的。 24 | 25 | ``` 26 | submodule..url 27 | ``` 28 | 29 | 定义可以从中克隆子模块存储库的URL。这可以是准备传递给 [git-clone [1]](https://git-scm.com/docs/git-clone) 的绝对URL,或者(如果它以./或../开头)相对于超级项目的原始存储库的位置。 30 | 31 | 此外,还有许多可选键: 32 | 33 | ``` 34 | submodule..update 35 | ``` 36 | 37 | 定义命名子模块的默认更新过程,即超级项目中“git submodule update”命令如何更新子模块。这仅由`git submodule init`用于初始化同名的配置变量。这里允许的值是_检出_, _rebase_ ,_合并_或_无_。有关其含义,请参阅 [git-submodule [1]](https://git-scm.com/docs/git-submodule) 中 _update_ 命令的说明。请注意,出于安全原因,此处有意忽略_!命令_表单。 38 | 39 | ``` 40 | submodule..branch 41 | ``` 42 | 43 | 用于跟踪上游子模块中的更新的远程分支名称。如果未指定该选项,则默认为 _master_ 。 `.`的特殊值用于指示子模块中分支的名称应与当前存储库中当前分支的名称相同。有关详细信息,请参阅 [git-submodule [1]](https://git-scm.com/docs/git-submodule) 中的`--remote`文档。 44 | 45 | ``` 46 | submodule..fetchRecurseSubmodules 47 | ``` 48 | 49 | 此选项可用于控制此子模块的递归获取。如果此选项也存在于超级项目的.git / config中的子模块条目中,则该设置将覆盖.gitmodules中的设置。通过使用“git fetch”和“git pull”的“ - [no-] recurse-submodules”选项,可以在命令行上覆盖这两个设置。 50 | 51 | ``` 52 | submodule..ignore 53 | ``` 54 | 55 | 定义在什么情况下“git status”和diff系列将子模块显示为已修改。支持以下值: 56 | 57 | ``` 58 | all 59 | ``` 60 | 61 | 子模块永远不会被视为已修改(但仍将显示在状态输出中并在提交时提交)。 62 | 63 | ``` 64 | dirty 65 | ``` 66 | 67 | 将忽略对子模块工作树的所有更改,仅考虑子模块的HEAD与其在超级项目中的记录状态之间的已提交差异。 68 | 69 | ``` 70 | untracked 71 | ``` 72 | 73 | 只有子模块中未跟踪的文件才会被忽略。将显示对跟踪文件的承诺差异和修改。 74 | 75 | ``` 76 | none 77 | ``` 78 | 79 | 不会忽略对子模块的修改,显示所有已提交的差异以及对已跟踪和未跟踪文件的修改。这是默认选项。 80 | 81 | 如果此选项也存在于超级项目的.git / config中的子模块条目中,则该设置将覆盖.gitmodules中的设置。 82 | 83 | 可以使用“--ignore-submodule”选项在命令行上覆盖这两个设置。 _git子模块_命令不受此设置的影响。 84 | 85 | ``` 86 | submodule..shallow 87 | ``` 88 | 89 | 设置为true时,除非用户明确要求非浅层克隆,否则此子模块的克隆将作为浅层克隆(历史深度为1)执行。 90 | 91 | ## 例子 92 | 93 | 请考虑以下.gitmodules文件: 94 | 95 | ``` 96 | [submodule "libfoo"] 97 | path = include/foo 98 | url = git://foo.com/git/lib.git 99 | ``` 100 | 101 | ``` 102 | [submodule "libbar"] 103 | path = include/bar 104 | url = git://bar.com/git/lib.git 105 | ``` 106 | 107 | 这定义了两个子模块,`libfoo`和`libbar`。这些预期将在路径 _include / foo_ 和 _include / bar_ 中检出,并且对于这两个子模块,指定了可用于克隆子模块的URL。 108 | 109 | ## 也可以看看 110 | 111 | [git-submodule [1]](https://git-scm.com/docs/git-submodule) [git-config [1]](https://git-scm.com/docs/git-config) 112 | 113 | ## GIT 114 | 115 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/55.md: -------------------------------------------------------------------------------- 1 | # git-clean 2 | 3 | > 原文: [https://git-scm.com/docs/git-clean](https://git-scm.com/docs/git-clean) 4 | 5 | ## 名称 6 | 7 | git-clean - 从工作树中删除未跟踪的文件 8 | 9 | ## 概要 10 | 11 | ``` 12 | git clean [-d] [-f] [-i] [-n] [-q] [-e ] [-x | -X] [--] …​ 13 | ``` 14 | 15 | ## 描述 16 | 17 | 通过从当前目录开始递归删除不受版本控制的文件来清除工作树。 18 | 19 | 通常,只删除Git未知的文件,但如果指定了`-x`选项,则也会删除被忽略的文件。例如,这可以用于删除所有构建产品。 20 | 21 | 如果给出任何可选的`<path>...`参数,则只会影响这些路径。 22 | 23 | ## OPTIONS 24 | 25 | ``` 26 | -d 27 | ``` 28 | 29 | 除了未跟踪的文件之外,删除未跟踪的目录。如果未跟踪的目录由不同的Git存储库管理,则默认情况下不会删除它。如果您确实要删除此类目录,请使用-f选项两次。 30 | 31 | ``` 32 | -f 33 | ``` 34 | 35 | ``` 36 | --force 37 | ``` 38 | 39 | 如果Git配置变量clean.requireForce未设置为false, _git clean_ 将拒绝删除文件或目录,除非给出-f,-n或-i。除非给出第二个-f,否则Git将拒绝使用.git子目录或文件删除目录。 40 | 41 | ``` 42 | -i 43 | ``` 44 | 45 | ``` 46 | --interactive 47 | ``` 48 | 49 | 显示将要执行的操作并以交互方式清理文件。有关详细信息,请参阅“交互模式” 50 | 51 | ``` 52 | -n 53 | ``` 54 | 55 | ``` 56 | --dry-run 57 | ``` 58 | 59 | 不要删除任何东西,只显示将要做的事情。 60 | 61 | ``` 62 | -q 63 | ``` 64 | 65 | ``` 66 | --quiet 67 | ``` 68 | 69 | 保持安静,仅报告错误,但不报告成功删除的文件。 70 | 71 | ``` 72 | -e 73 | ``` 74 | 75 | ``` 76 | --exclude= 77 | ``` 78 | 79 | 除了在.gitignore(每个目录)和$ GIT_DIR / info / exclude中找到的那些之外,还要考虑这些模式在有效的忽略规则集中。 80 | 81 | ``` 82 | -x 83 | ``` 84 | 85 | 不要使用从.gitignore(每个目录)和$ GIT_DIR / info / exclude读取的标准忽略规则,但仍然使用`-e`选项给出的忽略规则。这允许删除所有未跟踪的文件,包括构建产品。这可以使用(可能与 _git reset_ 一起使用)来创建一个pristine工作目录来测试一个干净的构建。 86 | 87 | ``` 88 | -X 89 | ``` 90 | 91 | 仅删除Git忽略的文件。这可能有助于从头开始重建所有内容,但保留手动创建的文件。 92 | 93 | ## 互动模式 94 | 95 | 当命令进入交互模式时,它显示要清理的文件和目录,并进入其交互式命令循环。 96 | 97 | 命令循环显示可用的子命令列表,并给出提示“What now>”。通常,当提示以单个_>结束时。_ ,您只能选择给定的一个选项并输入return,如下所示: 98 | 99 | ``` 100 | *** Commands *** 101 | 1: clean 2: filter by pattern 3: select by numbers 102 | 4: ask each 5: quit 6: help 103 | What now> 1 104 | ``` 105 | 106 | 只要选择是唯一的,您也可以说`c`或`clean`。 107 | 108 | 主命令循环有6个子命令。 109 | 110 | ``` 111 | clean 112 | ``` 113 | 114 | 开始清理文件和目录,然后退出。 115 | 116 | ``` 117 | filter by pattern 118 | ``` 119 | 120 | 这显示了要删除的文件和目录,并发出“输入忽略模式>>”提示。您可以输入以空格分隔的模式,以排除文件和目录的删除。例如。 “* .c * .h”将从删除中排除以“.c”和“.h”结尾的文件。如果对筛选结果感到满意,请按ENTER(空)返回主菜单。 121 | 122 | ``` 123 | select by numbers 124 | ``` 125 | 126 | 这显示了要删除的文件和目录,并发出“选择要删除的项目>>”提示。当提示以double _>>结束时_就像这样,你可以做多个选择,用空格或逗号连接起来。你也可以说范围。例如。 “2-5 7,9”从列表中选择2,3,4,5,7,9。如果省略范围中的第二个数字,则选择所有剩余项目。例如。 “7-”从列表中选择7,8,9。你可以说 _*_ 来选择一切。此外,当您对筛选结果感到满意时,请按ENTER(空)返回主菜单。 127 | 128 | ``` 129 | ask each 130 | ``` 131 | 132 | 这将开始清理,您必须逐个确认才能删除项目。请注意,此操作不如上述两个操作有效。 133 | 134 | ``` 135 | quit 136 | ``` 137 | 138 | 这样可以在不进行清洁的情况下退出。 139 | 140 | ``` 141 | help 142 | ``` 143 | 144 | 显示交互式git-clean的简要用法。 145 | 146 | ## 也可以看看 147 | 148 | [gitignore [5]](https://git-scm.com/docs/gitignore) 149 | 150 | ## GIT 151 | 152 | 部分 [git [1]](https://git-scm.com/docs/git) 套件 -------------------------------------------------------------------------------- /docs/58.md: -------------------------------------------------------------------------------- 1 | # git-reflog 2 | 3 | > 原文: [https://git-scm.com/docs/git-reflog](https://git-scm.com/docs/git-reflog) 4 | 5 | ## 名称 6 | 7 | git-reflog - 管理reflog信息 8 | 9 | ## 概要 10 | 11 | ``` 12 | git reflog 13 | ``` 14 | 15 | ## 描述 16 | 17 | 该命令采用各种子命令,并根据子命令使用不同的选项: 18 | 19 | ``` 20 | git reflog [show] [log-options] [] 21 | git reflog expire [--expire=