【问题标题】:capistrano - git ls-remote -h doesn't have the git urlcapistrano - git ls-remote -h 没有 git url
【发布时间】:2014-05-29 16:35:08
【问题描述】:

我刚开始使用 Capistrano。我设置正确,但是当我运行 cap staging deploy 时,我得到了这个 -

DEBUG [b678d5eb] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/myproj/git-ssh.sh /usr/bin/env git ls-remote -h  )
DEBUG [b678d5eb]    usage: git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>] <repository> <refs>...
DEBUG [b678d5eb] Finished in 0.325 seconds with exit status 129 (failed).

我认为 git clone url 应该跟在 -h 之后,但我不确定。

我正在使用 Capistrano 3.2.1。这是我的 deploy.rb -

lock '3.2.1'
set :application, 'myproj'
set :repository, 'https://vrao@git.test.com/scm/~vrao/myproj.git'
set :scm_passphrase, 'blah'

任何帮助都会很棒。

【问题讨论】:

    标签: git capistrano3


    【解决方案1】:

    没关系,我正在关注 capistrano 2x 的文档,而我安装了 3.2.1。

    对于任何可能面临相同问题的人,在 capistrano 2x 中,您通过设置存储库变量来指定 git repo,而在 3x 中它已更改为 repo_url。我改变了它,现在它工作正常。这是我建议遵循 3x 的文档- http://capistranorb.com/documentation/getting-started/installation/

    【讨论】:

      【解决方案2】:

      git clone URL 应该跟在-h 之后,但我不确定。

      确实,您已经找到了在您的情况下该 URL 为空的原因(错误的 capistrano 版本)

      在这种情况下,使用消息是(-hmeaning --heads没有 URL)。

      这已记录在 Git 2.25.2(2020 年 3 月)中。
      "git ls-remote -h" 和 "git grep -h" 都提供简短的使用帮助,就像任何其他 Git 子命令一样,但期望前者的行为与 "git ls-remote --head" 相同并不是不合理的(没有其他明智的行为后者)。

      已更新文档以试图澄清这一点。

      Junio C Hamano (gitster)commit 1ff466c(2020 年 2 月 27 日)。
      (由 Junio C Hamano -- gitster -- 合并于 commit cdef998,2020 年 3 月 11 日)

      Documentation:澄清-h 单独代表help

      我们似乎每 20 个月左右就会有新用户对此感到困惑,“-h 一直想要提供帮助,但 -h 的命令可能感觉像是一个很好的短格式选项希望它提供帮助还有别的意思。”妥协。

      让我们确保读者知道 git cmd -h(没有其他参数)是获取使用文本的一种方式,即使对于像 ls-remotegrep 这样的命令也是如此。

      同时扩展gitcli.txt 中已有的描述,因为很明显用户仍然对当前文本感到困惑。

      git ls-remote documentation 现在包括:

      请注意,git ls-remote -h 在命令行中使用时没有其他任何内容提供帮助,与其他 git 子命令一致

      还有gitcli:

      请注意,当命令行中存在-h 以外的内容时,某些子命令(例如git grep -h xxx)的行为可能会有所不同,但命令行中没有任何其他内容的git subcmd -h 旨在始终如一地给出用法。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-06-30
        • 2017-07-06
        • 1970-01-01
        • 1970-01-01
        • 2014-04-09
        • 2014-12-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多