git - 管道和瓷器命令是什么?

标签 git

对于 git 命令,“plumbing”和“porcelain”命令之间存在这种区别。我怎样才能确定什么会被归类为管道设备或瓷器?即允许我区分的边界线是什么?

我不是在问瓷器或管道命令是什么,而是在给定命令的情况下,我如何说出它是哪种类型。

最佳答案

作为blue112 noted , 分界线是模糊的。 The very first documentation page ,但是,有一个明确的列表(和 as R.M. notes below ,一个主要标准是,或者至少应该是,接口(interface)的稳定性——为此一些名义上的陶瓷命令有 --porcelain1 强制更稳定和/或更机器可读的输出)。您可以选择使用他们的列表,或者决定某些命令级别太高不能成为低级别,或者级别太低不能成为高级。例如,您可能不同意 git apply是管道命令,但 Git 页面说它是。或者,您可能会考虑像 git fast-import 这样的事情成为你只会在脚本中使用的东西。

Edit, 31 May 2020: The Git documentation has changed since 2016 to reassign commands to new sections; the data below are now out of date. Consult the documentation for your own Git version (via git help git for instance) to see what your own system says. See also VonC's answer with a link to a 2018 change to the documentation.

下面的列表只是从文档中摘录,去除了描述和其他分类,只留下“瓷器”与“管道”。 (子分类在字母排序顺序中仍然可见,因为倒置。我没有为每个条目构建链接,因为使用 StackOverflow markdown 这会困难得多——这只需要一个简单的

...
包装器.)

瓷器

git-add                 git-rebase              git-cherry
git-am                  git-reset               git-count-objects
git-archive             git-revert              git-difftool
git-bisect              git-rm                  git-fsck
git-branch              git-shortlog            git-get-tar-commit-id
git-bundle              git-show                git-help
git-checkout            git-stash               git-instaweb
git-cherry-pick         git-status              git-merge-tree
git-citool              git-submodule           git-rerere
git-clean               git-tag                 git-rev-parse
git-clone               git-worktree            git-show-branch
git-commit              gitk                    git-verify-commit
git-describe            git-config              git-verify-tag
git-diff                git-fast-export         git-whatchanged
git-fetch               git-fast-import         gitweb
git-format-patch        git-filter-branch       git-archimport
git-gc                  git-mergetool           git-cvsexportcommit
git-grep                git-pack-refs           git-cvsimport
git-gui                 git-prune               git-cvsserver
git-init                git-reflog              git-imap-send
git-log                 git-relink              git-p4
git-merge               git-remote              git-quiltimport
git-mv                  git-repack              git-request-pull
git-notes               git-replace             git-send-email
git-pull                git-annotate            git-svn
git-push                git-blame

管道

git-apply               git-for-each-ref        git-receive-pack
git-checkout-index      git-ls-files            git-shell
git-commit-tree         git-ls-remote           git-upload-archive
git-hash-object         git-ls-tree             git-upload-pack
git-index-pack          git-merge-base          git-check-attr
git-merge-file          git-name-rev            git-check-ignore
git-merge-index         git-pack-redundant      git-check-mailmap
git-mktag               git-rev-list            git-check-ref-format
git-mktree              git-show-index          git-column
git-pack-objects        git-show-ref            git-credential
git-prune-packed        git-unpack-file         git-credential-cache
git-read-tree           git-var                 git-credential-store
git-symbolic-ref        git-verify-pack         git-fmt-merge-msg
git-unpack-objects      git-daemon              git-interpret-trailers
git-update-index        git-fetch-pack          git-mailinfo
git-update-ref          git-http-backend        git-mailsplit
git-write-tree          git-send-pack           git-merge-one-file
git-cat-file            git-update-server-info  git-patch-id
git-diff-files          git-http-fetch          git-sh-i18n
git-diff-index          git-http-push           git-sh-setup
git-diff-tree           git-parse-remote        git-stripspace

1将此称为--plumbing 似乎更合乎逻辑,但作为VonC notes in this answer to a related question ,可以将其视为一个请求:“我正在实现瓷器,所以请给我管道式输出。”这个论点的缺陷在于,您可能正在实现复杂的管道,并希望使用简单的管道来做到这一点:现在看不到瓷器,但是,您的复杂管道将 --porcelain 传递给某些人简单的管道。

关于git - 管道和瓷器命令是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39847781/

相关文章:

Git merge 与 Yaml 文件冲突

git - Heroku 的新手 : Error when push my app to Heroku

git - 应该使用 Git 来存储持续集成构建吗?

java - Jenkins发现找不到ssh key

eclipse - 在 Eclipse/EGit 中有没有办法编辑未推送/本地提交的提交消息?

git merge 不创建 merge 提交,没有 MERGE_HEAD

git - 为什么 merge 需要您考虑共同的祖先?

git - 显示 Git 索引中和工作副本中更改的文件

git - Atlassian Soucetree 2.3.1.0 : Difference between 'remove' and 'discard'

git - Web 开发问题的基本版本控制 - 单个开发人员。 (SVN/GIT)