LoginSignup
1
0

More than 3 years have passed since last update.

アプリを作成してGitHubと同期する

Last updated at Posted at 2019-10-19

3行で

  • 共有
  • コミット
  • 同期

はじめに

とりあえずアプリを作っておく。
GitHubでリモートリポジトリを作っておく。作り方は割愛。
それから作ったアプリのディレクトリに移動しておく。

アプリ名 $ 

この状態。

Gitを使う準備をする

アプリ名 $ git init

init はinitialize(初期化)の略。

共有するファイルを選択する

アプリ名 $ git add .

. はオプションであり、アプリ内のファイルすべてを共有する場合に使う。

メッセージ付きでcommitする

アプリ名 $ git commit -m "first commit"

コメント名は任意ですが他人が見てわかりやすいものにする。

リモートリポジトリと同期する

アプリ名 $ git remote add origin リモートリポジトリのURL

リモートリポジトリにファイルをpushする

アプリ名 $ git push -u origin master

git push -u オプションの意味

GitHubのリモートリポジトリにアクセスして、pushしたものが表示されていれば成功してます。

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