134
101

More than 5 years have passed since last update.

ローカルリポジトリをリモートにpushするまで

Posted at

ローカルで作ったプロジェクトをGithubにあげる際の手順。
ちょいちょいやるのに毎回忘れるので、備忘録。

前提

公開鍵は作れているものとして、進めていきます。
もし、公開鍵を作成していない場合はこちらを参考に設定してください。

では実践

// cdコマンドを使って、該当のディレクトリまで移動
// 今回はworkspace/hogeを例に
$ cd workspace/hoge

// gitを初期化
$ git init

// ステージングにあげる
$ git add .

// 最初のコミットメッセージを書く
$ git commit -m "first commit"

// リモートにアクセス
$ git remote add origin ここにgithubで作ったリポジトリのURL
// 例
$ git remote add origin https://github.com/hoge/hoge.git

//masterへpush
$ git push origin master

以上で完了です。

134
101
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
134
101