0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

新規アプリケーションをGithubで管理する(Rails)

Last updated at Posted at 2019-12-18

はじめに

Railsを使ってプログラミングの学習をしているのですが、新規アプリケーションを作成する際、Githubで管理する方法を忘れてしまうので、定着させる意味でも残したいと思います。

環境

OS: Mac
Rails 5.0.7.2
Ruby 2.5.1
MySQL
Github Desktop

手順

1,新規アプリケーションを作成

ターミナル
$ cd myapp #作成したいディレクトリへ移動
$ rails _5.0.7.2_ new my-blog -d mysql #Railsのバージョンを指定、DBはMySQLを指定する。
$ cd my-blog #作成したアプリケーションのディレクトリへ移動
$ rails db:create #データベース作成

2,Github Desktopからローカルリポジトリにする

スクリーンショット 2019-12-18 1.24.07.png Github Desktop左上の`Current Repository`をクリック→`Add`→`Add Existing Repository`を選択。 スクリーンショット 2019-12-18 1.29.51.png 選択画面が出てくるので、作成したアプリを選択。

Add Repositoryできない場合
ターミナルにて、作成したアプリのリポジトリ→git initのコマンドを打てば解消されます。

スクリーンショット 2019-12-18 1.32.55.png 左下から最初のコミットをする。スクリーンショット 2019-12-18 1.34.44.png `Publish repository`をクリック。 スクリーンショット 2019-12-18 1.35.12.png 公開してもいいなら`Keep this code private`のチェックを外し、`Publish Repository`をクリック。

3,Githubのリモートリポジトリが作成される

スクリーンショット 2019-12-18 1.40.05.png Githubの`Your Repositories`に作成したアプリが登録されていれば完了です。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?