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.7.3.3.3. 将应用程序存储在 Git 中
如果您尚未安装 OpenShift Container Platform,则需要安装 git。
在 OpenShift Container Platform 中构建应用程序通常需要将源代码存储在 git 存储库中,因此如果您还没有 git
,则需要安装 git。
运行 ls -1
命令,确保已在 Rails 应用程序目录中。命令输出应类似于:
现在,在 Rails 应用程序目录中运行这些命令以初始化代码并将其提交给 git:
git init git add . git commit -m "initial commit"
$ git init
$ git add .
$ git commit -m "initial commit"
提交应用程序后,您需要将其推送(push)到远程存储库。为此,您将需要一个 GitHub 帐户,用于 创建新存储库。
设置指向 git
存储库的远程存储库:
git remote add origin git@github.com:<namespace/repository-name>.git
$ git remote add origin git@github.com:<namespace/repository-name>.git
之后,将应用程序推送到远程 git 存储库。
git push
$ git push