気軽に楽しくプログラムと遊ぶ

自分が興味があってためになるかもって思う情報を提供しています。

git基本コマンド(リポジトリの初期化〜リモートリポジトリへの登録)

gitリポジトリ初期化

$ git init


ステージングエリアに登録

$ git add .


ステージングエリアにあるファイルのリストを表示

$ git status


変更を保存

$ git commit -m "Initialize repository"


masterブランチ用のoriginを登録

$ git remote add origin https://github.com/<username>/first_app.git


リモートリポジトリに登録(プッシュ)

# masterブランチへ登録する場合はブランチ名を省略出来る
$ git push

# ブランチ指定
$ git push -u origin <ブランチ名>