ブランチを作成する
git branch branch_name
ブランチを作成して、チェックアウトもする
git checkout -b branch_name
ブランチを削除する
git branch -d [branchname]
ブランチを切り替える
git checkout branch_name
ファイル状況を確認する
git status
ファイル単位でインデックスに追加する
git add file_path file_path file_path
全変更ファイルをインデックスに追加する
git add .
詳細メッセージ込みのコミットする
git commit
タイトルのみでコミット�する
git commit -m 'message'
コミットを取り消す(ログを残す)
git revert [commit_number]
直前のコミットを取り消す(ログを残さない)
git reset --hard HEAD^
プッシュする
git push [reponame] [branchname]:[branch]
プルする
git pull [reponame] [branch]
インデックスにあげたファイルを戻す
git reset HEAD file_path
ブランチ一覧を見る
git branch
リモートブランチ込みでブランチ一覧を見る
git branch -a
コミットログを見る
git log
マージ状況もわかるログを見る
git log --graph
リモートリポジトリを追加する
git remote add origin [url]