【问题标题】:Git clone in script脚本中的 Git 克隆
【发布时间】:2012-02-28 00:22:02
【问题描述】:

我正在编写一个需要克隆 git 代表的 bash 脚本。我怎样才能做到这一点,当它出现时,它会自动将值 yes 放入?

==============================================================================
= NOTICE                                                                     =
==============================================================================
= RVM has encountered a new or modified .rvmrc file in the current directory =
= This is a shell script and therefore may contain any shell commands.       =
=                                                                            =
= Examine the contents of this file carefully to be sure the contents are    =
= safe before trusting it! ( Choose v[iew] below to view the contents )      =
==============================================================================
Do you wish to trust this .rvmrc file? (/root/The-Three-Little-Pigs-Siri-Proxy/.rvmrc)
y[es], n[o], v[iew], c[ancel]> 

Ubuntu 10.10 32 位

【问题讨论】:

  • 什么是 RVM,为什么它会干扰您的 git clone?
  • @GregHewgill - 它是 Ruby 版本管理器。可能是脚本克隆并 cds 进入其中。如果文件夹有 .rvmrc 文件,这将触发 rvm 挂钩。无论如何,删除 git 标签并添加 rvm。
  • 正确,脚本克隆然后 cds 进入它。
  • 使用linux 标签而不是ubuntu 会更好吗?由于该问题与特定于 ubuntu 的事物无关。
  • 我会改变它,我不确定所以我想我会尽可能具体

标签: linux rvm


【解决方案1】:

在您的主目录中创建一个文件 .rvmrc 并在其中添加以下行:

rvm_trust_rvmrcs_flag=1

或通过以下方式信任文件:

rvm rvmrc trust /root/The-Three-Little-Pigs-Siri-Proxy/

【讨论】:

  • /home 还是我要克隆到的目录?
  • 我认为他的意思是/home/username,或~
【解决方案2】:

您可以查看expect

【讨论】:

    猜你喜欢
    • 2012-06-07
    • 1970-01-01
    • 2016-12-17
    • 2013-08-07
    • 1970-01-01
    • 2017-02-09
    • 2011-12-14
    • 2013-08-04
    • 2019-06-07
    相关资源
    最近更新 更多