Git コマンド - Himeyama/himeyama GitHub Wiki
バージョン確認
git --version
初期化
git init
ユーザー名の設定
git config user.name "NAME"
リポジトリの状況を確認
git status
data.txt
をステージング
git add data.txt
変更があったファイルをすべてステージング
git add -A
# カレントディレクトリー以下に限定する場合は
# git add .
コミット
git commit -m 'MESSAGE'
リポジトリの状況を短く
git status --short
ステージングとコミットを一括で行う ただし、初回のみステージング (
git add
) が必要
git commit -a -m 'MESSAGE'
変更履歴を見る
git log
git status
について調べる
git status -help
実行可能なコマンドをすべて表示する
git help --all
hello-world
ブランチの作成
git branch hello-world
ブランチ一覧を表示
git branch
hello-world
ブランチへ切り替え
git checkout hello-world
hello-world
ブランチの作成と切り替え
git checkout -b hello-world
リモートブランチの削除
git push --delete origin <ブランチ名>
空のブランチの作成
git checkout --orphan <ブランチ名>
以下参照されたい。