* 004 - (HEAD -> master) Reorder header nav item in HTML * 003 - Add class switch with jQuery for header navigation to JavaScript * 002 - Add class for header navigation to CSS * 001 - Add section for header navigation to HTML 各ファイルでの変更を それぞれ別のcommitに 当初の⽬的は達成されたようだが… テーマを戻したくなったら 3 commit分のrevertが必要 「不適切に」原⼦性が⾼い
-4 * 004 - (HEAD -> master) Reorder header nav item in HTML * 003 - Update header navigation themes * 002 - Enable SP header button appending new selector to HTML and JS * 001 - Use background-image on div instead of img element 意味的にまとまる範囲で commitへまとめた ⼩さなcommitを意識しつつ、 意味的にまとまっていると 戻す時もまとめて戻せる 「ファイルの粒度」ではなく 「意味の粒度」にまとめる
branch master Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: index.html modified: script.js modified: style.css no changes added to commit (use "git add" and/or "git commit -a") imaizume@mac ~/works/pretty-git (master) $ git add index.html git addの最小単位はファイルだと思っていませんか??
-4 * 004 - (HEAD -> master) Reorder header nav item in HTML * 003 - Update header navigation themes * 002 - Enable SP header button appending new selector to HTML and JS * 001 - Use background-image on div instead of img element ❌複数の意味を持つ変更を1commitに 1⾏/ファイル毎に変更を1commitに ⭕ 意味の最⼩粒度で1commitに 頑張りましょう
vimにJqコマンドを追加 pick 2b9c492 write !pbcopyとsortコマンドのキーマップを追加 # Rebase 59d63fc..2b9c492 onto 59d63fc (2 commands) # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # d, drop = remove commit # # These lines can be re-ordered; they are executed from top to bottom. # # If you remove a line here THAT COMMIT WILL BE LOST. # # However, if you remove everything, the rebase will be aborted. # # Note that empty commits are commented out git rebase -i での画面説明 どのcommitまで遡るか vimが起動するので ⾏頭の単語と順序を編集後 保存して閉じる 各サブコマンド