よく使う Git コマンド一覧
基本コマンド
コマンド | 説明 | 使用例 |
---|---|---|
git clone url | クローン。リモートからソースを取得 | git clone https://github.com/sbc-f/web.git |
git init | リポジトリ作成 | - |
git add . | 変更の反映(新規/変更) | - |
git commit -m “~” | コミット | git commit -m “first commit” |
git remote -v | リモートの確認 | - |
git remote add リモート名 url | リモートの追加 | git remote add web https://git.heroku.com/sbc-web.git |
git push リモート名 ブランチ名 | リモートにプッシュ | git push web master |
変更後の流れ
№ | コマンド | 使用例 |
---|---|---|
1 | 変更の反映 | git add . |
2 | コミット | git commit -m “commit” |
3 | プッシュ | git push web master |