首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用OpenShift应用程序的git添加命令在我的应用程序文件夹中添加文件

无法使用OpenShift应用程序的git添加命令在我的应用程序文件夹中添加文件
EN

Stack Overflow用户
提问于 2015-08-17 14:10:47
回答 2查看 129关注 0票数 0

我在OpenShift中创建了一个应用程序,但无法添加文件。我完成了以下步骤。

代码语言:javascript
复制
 D:\openshft>rhc git-clone firstapp --namespace <namespace>
    Cloning into 'firstapp'...
    remote: Counting objects: 47, done.
    remote: Compressing objects: 100% (37/37), done.
    remote: Total 47 (delta 5), reused 37 (delta 1)
    Receiving objects: 100% (47/47), 51.73 KiB | 0 bytes/s, done.
    Resolving deltas: 100% (5/5), done.
    Checking connectivity... done.
    Checking out files: 100% (36/36), done.
    Your application Git repository has been cloned to 'D:\openshft\firstapp'

之后,我在D:\openshft\firstapp\src\main\webapp目录中添加了test.html文件。

代码语言:javascript
复制
D:\openshft>rhc git add .
Usage: rhc git-clone <app> [--namespace NAME]

This is a convenience wrapper for 'git clone' with the added benefit of adding
configuration data such as the application's UUID to the local repository.  It
also automatically figures out the Git url from the application name so you
don't have to look it up.


Options
  -n, --namespace NAME      Name of a domain
  -r, --repo dir            Path to the Git repository (defaults to ./$app_name)

  -a, --app NAME            Name of an application

Global Options
  -l, --rhlogin LOGIN       OpenShift login
  -p, --password PASSWORD   OpenShift password
  --token TOKEN             An authorization token for accessing your account.
  --server HOSTNAME         An OpenShift server hostname (default:
                            openshift.redhat.com)
  --timeout SECONDS         The timeout for operations

  See 'rhc help options' for a full list of global options.

D:\openshft\firstapp\src\main\webapp>rhc git add
Usage: rhc git-clone <app> [--namespace NAME]

This is a convenience wrapper for 'git clone' with the added benefit of adding
configuration data such as the application's UUID to the local repository.  It
also automatically figures out the Git url from the application name so you
don't have to look it up.


Options
  -n, --namespace NAME      Name of a domain
  -r, --repo dir            Path to the Git repository (defaults to ./$app_name)

  -a, --app NAME            Name of an application

Global Options
  -l, --rhlogin LOGIN       OpenShift login
  -p, --password PASSWORD   OpenShift password
  --token TOKEN             An authorization token for accessing your account.
  --server HOSTNAME         An OpenShift server hostname (default:
                            openshift.redhat.com)
  --timeout SECONDS         The timeout for operations

  See 'rhc help options' for a full list of global options.

我还尝试了其他一些命令,但没有成功。谁能告诉我添加文件的正确步骤或命令?

EN

回答 2

Stack Overflow用户

发布于 2015-08-17 14:14:55

您正在使用一个包装器脚本rhc,它并不支持所有的git命令--只支持git clone。它提供的包装器功能对于git clone很有用,但对于任何其他git命令都不是必需的。

删除前缀后的原始命令git add .将添加当前目录(包括所有文件以及其中所有子目录的文件)。

票数 2
EN

Stack Overflow用户

发布于 2015-08-17 20:07:28

D:\openshft>rhc git add .

D:\openshft\firstapp\src\main\webapp>rhc git add

使用不带rhcgit add。添加文件,而不是目录。D:\openshft\firstapp\src\main\webapp>git add test.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32043788

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档