我在OpenShift中创建了一个应用程序,但无法添加文件。我完成了以下步骤。
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文件。
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.我还尝试了其他一些命令,但没有成功。谁能告诉我添加文件的正确步骤或命令?
发布于 2015-08-17 14:14:55
您正在使用一个包装器脚本rhc,它并不支持所有的git命令--只支持git clone。它提供的包装器功能对于git clone很有用,但对于任何其他git命令都不是必需的。
删除前缀后的原始命令git add .将添加当前目录(包括所有文件以及其中所有子目录的文件)。
发布于 2015-08-17 20:07:28
D:\openshft>rhc git add .
D:\openshft\firstapp\src\main\webapp>rhc git add
使用不带rhc的git add。添加文件,而不是目录。D:\openshft\firstapp\src\main\webapp>git add test.html
https://stackoverflow.com/questions/32043788
复制相似问题