1
0

More than 3 years have passed since last update.

初学者向けgithubのコマンド集

Posted at

gitのコマンドを忘れないようにするためのメモ

 忘れないようにするためのメモです。
 使っていただければ幸いです。

gitのログを見やすくする方法

 参考ページ

githubにリモートリポジトリを作成した際に行うこと

$ git remote add origin https://github.com/<あなたのGitHubアカウント名>/sample_app.git
$ git push -u origin master

originとmasterについて

参考ページ

ブランチを途中のコミットまでpushしたい

参考ページ

基本コマンド

・修正した内容をコメント付きでコミット
 $ git commit -am "HelloWorldメソッドを変更"
・初回コミットの際
 $ git init
 $ git add -A
 $ git commit -m "Initialize repository"

・herokuにpushするときの手順
 $ git commit -am "Add hello"
 $ git push
 $ heroku create
 $ git push heroku master

・herokuのlog取得方法
 $ heroku logs   # 直近のイベントを表示する
 $ heroku logs --tail  # イベント発生のたびに自動表示する(Ctrl-Cで終了)

・ブランチのチェクアウト
 $ git checkout -b static-pages

・チェックアウトしたブランチでコミットする場合
 $ git add -A
 $ git commit -m "Add a Static Pages controller"
 $ git push -u origin static-pages

・現在のブランチの状況を知る場合

 $ git status
 $ git branch

以上

また、追加で学んだことがありましたら追記して行きます。
便利なコマンドがありましたら、コメントしていただけると嬉しいです。

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