LoginSignup
3
6

More than 3 years have passed since last update.

「git」初心者のgit

Posted at

はじめに

git初心者です。
初めて使用したので備忘録としてメモしてます。
※(大まかな流れだけを書いています)

流れ

1 ディレクトリに移動
2 現在のディレクトリにリポジトリを作成
3 ステージに追加
4 ローカルリポジトリにコミット
5 リモートリポジトリとの連携
6 リモートリポジトリに追加
7 herokuにログイン
8 heroku上にアプリを作成
9 herokuにデプロイ

コマンド

1 ディレクトリに移動

cd ディレクトリ名

2 現在のディレクトリにリポジトリを作成(ローカルリポジトリ)

git init

3 ステージに追加(-AでAll)

git add -A

4 ローカルリポジトリにコミット

git commit -m 'コメント'

5 リモートリポジトリとの連携(githubでリモートリポジトリを作成済み)

git remote add origin 'githubのURL'

6 リモートリポジトリに追加(-uでupstream)

git push -u origin master

7 herokuにログイン(もっと短縮できるはず、、)

heroku login

8 heroku上にアプリを作成

heroku create

9 herokuにデプロイ

git push heroku master

二回目以降

1 git commit -am 'コメント'
2 git push
3 git push heroku

3
6
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
3
6