【问题标题】:Does the `git checkout --` command have anything to do with the `--` argument of bash?`git checkout --` 命令与 bash 的 `--` 参数有什么关系吗?
【发布时间】:2019-12-11 08:21:17
【问题描述】:

当我遇到-- argument of bash 时,我正试图导出带有破折号的路径的 bash 环境变量。我注意到它似乎与git 中的how one checks out a single file of some version 相似。

这两者有什么关系吗,是不是同一个东西,是不是同一个目的?

【问题讨论】:

    标签: bash git arguments


    【解决方案1】:

    -- 不是特定于bash 的任何东西;这是许多命令在处理其参数时遵循的约定。按照惯例,出现在-- 之后的任何参数都不应被视为一个选项,即使存在该名称的选项。

    建议将此约定作为POSIX Utility Syntax Guidelines 中的准则#10。

    【讨论】:

      猜你喜欢
      • 2018-11-23
      • 1970-01-01
      • 2021-12-06
      • 1970-01-01
      • 2017-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-22
      相关资源
      最近更新 更多