This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.11.3.3. アプリケーションの Git への保存
通常 OpenShift Container Platform でアプリケーションをビルドする場合、ソースコードを git リポジトリーに保存する必要があるため、git
がない場合にはインストールしてください。
前提条件
- git をインストールします。
手順
ls -1
コマンドを実行して、Rails アプリケーションのディレクトリーで操作を行っていることを確認します。コマンドの出力は以下のようになります。Copy to Clipboard Copied! Toggle word wrap Toggle overflow ls -1
$ ls -1 app bin config config.ru db Gemfile Gemfile.lock lib log public Rakefile README.rdoc test tmp vendor
- Rails app ディレクトリーで以下のコマンドを実行して、コードを初期化し、git にコミットします。
git init git add . git commit -m "initial commit"
$ git init
$ git add .
$ git commit -m "initial commit"
+ アプリケーションがコミットされたら、これをリモートリポジトリーにプッシュする必要があります。新規リポジトリーを作成する GitHub アカウントです。
お使いの
git
リポジトリーを参照するリモートを設定します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow git remote add origin git@github.com:<namespace/repository-name>.git
$ git remote add origin git@github.com:<namespace/repository-name>.git
アプリケーションをリモートの git リポジトリーにプッシュします。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow git push
$ git push