0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

初心者がGitHubに自分のアプリを上げる方法

Posted at

#前提条件
Githubに登録していること
アプリがあること

#大きな流れ
①ワーキングツリーを作成
②インデックスにファイルを登録
③ローカルリポジトリにファイルを登録
④リモートリポジトリと接続
⑤リモートリポジトリにファイルを登録

##前提
GitHubにアップしたいファイルがあるフォルダにがカレントディレクトリであること

##①ワーキングツリーを作成
git init

.gitが生成されていることを確認
ls -a

##②インデックスにファイルを登録
git add *

備考
*はワイルドカードで、カレントディレクトリにある全てのファイルをインデックスに登録している

##③ローカルリポジトリにファイルを登録
git commit -m 'test'

備考
-mはコミットに対してコメントを付ける機能でつけてもつけなくてもいいです。

確認
コミットされたことを確認
git log
Author: xxx
Date: Sun xxx xx 17:35:23 2020 +0900

test

##④リモートリポジトリと接続
git remote add origin https://github.com/xxxxxxxx/xxxxxxxx.git


備考
originはリモートリポジトリ名で、任意の名前をつけても良い。基本はorigin
https/://github.com/xxxxxxxx/xxxxxxxx.gitはリモートリポジトリURL。GitHubのウェブページでリポジトリを作成すると付与される。(多分リポジトリページにそれらしきものはある)


確認
git remote -v

備考
接続しているリモートリポジトリ先が表示される

##⑤リモートリポジトリにファイルを登録
git push origin master


備考
masterはブランチ名。デフォルトがmaster。
自分の今いるブランチを確認したい場合は以下コマンド
git branch --contains


確認
自分のGitHubのリポジトリページにアクセスしてアップロードされていることを確認

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?