自分用です。
設定関係
設定には3つあり、system,global,localの順に読み込まれる
- system
- システム全体の設定
- global
- 概要ユーザーの全リポジトリ
- local
- 該当リポジトリ
現在有効な設定の確認
git config -l
個別に設定を確認
git config --local -l
git config --global -l
git config --system -l
設定の編集
git config user.name example
git config user.email example@example.com
GitHub
githubへつなぐ手順はgitでrepositoryを作成すると出てくるので省略。
ファーストコミットが終了した後の処理
GitHubに変更を上げる
git pull origin master
git push origin master
pullでマージしてから、pushで上げる
ローカルの変更取り消し
git checkout .
前回のコミットからファイルの変更をリセットしてくれる。
新規追加したファイルは削除されない。
完全に元に戻したいのであれば別途消去コマンドを打つ。
git clean -df .
※オプションの意味
-d: ディレクトリを削除対象に含める。
-f(--force): ファイル削除を強制的に実行する。
ステージへのaddの取り消し
ステージにaddした変更もリセットする場合は下記。
git reset HEAD .