Learn or Die

生涯勉強。Macです。

ローカルリポジトリをGitHubにpushする

備忘録。
公開鍵は作成済み、GitHubに設定できているものとします。

手順

//該当ディレクトリに移動する
$ cd workspace/test

//ディレクトリをgit管理下に置く(初期化)
$ git init

//ディレクトリの状態を確認
$ git status

//コミット
$ git commit -m "first commit"

//リモート(GitHub)にアクセス
$ git remote add origin https://github.com/[GitHubのアカウント名]/[リモートのリポジトリ名].git

//masterブランチへpush
$ git push origin master