githubやherokuの操作等

いつもググるのでメモ代わり、増えたり増えなかったりする

GitHub

新しいローカルプロジェクトをGithubにアップロードする

事前にGithubで新規リポジトリを作成しておく

# プロジェクトのディレクトリへ移動
$ cd hogehoge
$ git add README.md
# 初期化
$ git init
# 全ファイル追加
$ git add .
$ git commit -m "コミット時のコメント"
# リモートブランチの設定
$ git remote add origin git@github.com:user/hogehoge.git
# アップロード
$ git push -u origin master

不要なファイル/ディレクトリを削除する

# プロジェクトのディレクトリへ移動
$ cd hogehoge
# ファイル/フォルダの削除
$ git rm ファイル名
$ git rm -r フォルダ名
# コミット
$ git add .
$ git commit -m "comment"
$ git push

heroku

はじめに

# ログイン
$ heroku login
# 作業フォルダへ移動
$ cd hogehoge

botの起動/停止

# botの起動
$ heroku ps:scale bot=1
# botの停止
$ heroku ps:scale bot=0

修正したソースのpush

# 初期化
$ git init
# 追加
$ git add .
# コメント
$ git commit -am "comment"
# push
$ git push heroku master



この記事が気に入ったらサポートをしてみませんか?