1 2 3 4 5 6 7 8
- ! - ! - !
# 設定 git config <対象(なし:カレント, --global:グローバル, --system:システム全体)> <名前> <値> # 設定の確認 git config -l # エディタで編集 git config -e
1 2 3 4
git config --global user.name "<名前>" git config --global user.email "<メールアドレス>" git config --global color.ui auto git config --global core.editor vim
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
- ! - ! - ! - ! - ! - !
# 初期化 git init # 追加 git add <ファイル> # ファイル自体は消さずに、管理対象から削除 git rm --cached <ファイル> # コミット git commit -a # リモート先登録 git remote add origin <URL> # push git push -u origin master
1
git clone <URL>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
- ! - ! - ! - ! - ! - ! - ! - !
# 作業ツリーの状態 git status # ブランチの履歴 git log # 1行スタイル git log --oneline # 直近5件分 git log -5 # インデックスと作業ツリーの差分 git diff # HEADとインデックスの差分 git diff -HEAD # コミットと作業ツリーの差分 git diff <commit> # コミット差分 git show <object>
1 2
- !
# デフォルトのリモートリポジトリから変更を取得 git pull