LoginSignup
1
0

More than 1 year has passed since last update.

Railsで作成したアプリをGitHubで管理する方法

Last updated at Posted at 2022-03-25

結論    

アプリを保管するための倉庫を自分のパソコン(local repository)とGitHub(remote repository)上に作成して、送り込む(push)。

ちなみに

remote: 遠隔
local: 地元
repository: 倉庫、保管庫

1.リモートリポジトリを作成

GitHubで新規リポジトリを作成する。

2.ローカルリポジトリを作成し、送り込むための準備

$ git init        #local ripositoryが作成されるだけ

$ git add .   
 
 # 編集中のコードをGitで管理対象にするという意味のコマンド   
 # 'index'にステージングともいう

$ git commmit -m  ”どんな機能を実装したのか等のコメントを残す”  
 
 #local repositoryにプログラムを保存するコマンド
 #これでremote repositoryに送り込む準備は整った

ちなみに

initialize:初期化、使える状態にする
add: ~を追加する
commit: 記録などを書き留める

3.ローカルリポジトリからリモートリポジトリへ送り込む

$ git remote add origin URL #GitHubでURLをコピーし、貼り付ける
 #データの送り込み先を指定している

$ git push origin HEAD
 #local reppsitory から remote repository へ送り込まれる

これでGitHubで管理することができます。
以上です。

1
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
1
0