0
0

More than 1 year has passed since last update.

Githubにプッシュする方法

Posted at

リモートリポジトリにファイルをアップロード

ターミナルでgitコマンドを入力してリモートリポジトリにファイルをプッシュします。

前提として...

・ターミナルでgitインストール済み
・Github登録済み



Githubで新しいリポジトリを作成します。
リポジトリ名はmyblogにします。

ターミナルに以下を順番に実行していきます。
Gitで管理するディレクトリを作成して移動します。

$ mkdir myblog
$ cd myblog

Gitで管理できるように以下を実行します。

$ git init

先程Githubで作ったmyblogリポジトリのhttpsから始まるURLをコピーしてきて、コマンドを実行します。

$ git remote add origin [URL]

プッシュ先のリモートリポジトリを指定する為に、
以下のように書きます。

$ git remote add origin https://github.com/Kaana0/myblog.git  

ファイルを作成してコミットします。
以下のコマンドを順番に実行します。

$ touch index.html
$ git add index.html
$ git commit -m "Create index.html"

プッシュしていきます。

$ git push origin master

無事にプッシュ出来たので、 Githubのmyblogリポジトリを確認してみましょう!

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