0

I created an application in OpenShift but not able to add a file. I did the following steps.

 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'

After that I add test.html file in D:\openshft\firstapp\src\main\webapp directory.

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.

I also try some other commands, but not succeed. Can anyone tell me correct steps or command to add a file?

Khaino
  • 3,774
  • 1
  • 27
  • 36

2 Answers2

2

You're using a wrapper script, rhc, which doesn't support all git commands--only git clone. The wrapper functionality it provides is useful for git clone, but not necessary for any other git commands.

Your original command with the prefix removed, git add ., will add the current directory (including all files, and the files of all subdirectories inside).

Jeff Bowman
  • 90,959
  • 16
  • 217
  • 251
0

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


Use the git add without rhc. Add files, not directories. D:\openshft\firstapp\src\main\webapp>git add test.html

user32
  • 177
  • 1
  • 2