Upgrade to Pro — share decks privately, control downloads, hide ads and more …

計算機科学実験及び演習のための Git / Git for Hardware and Soft...

計算機科学実験及び演習のための Git / Git for Hardware and Software Laboratory Project

Yusuke Miyazaki

April 14, 2016
Tweet

More Decks by Yusuke Miyazaki

Other Decks in Programming

Transcript

  1. ࡞ۀͷྲྀΕ 8PSLJOH ࡞ۀσΟϨΫτϦ 4UBHJOH )JTUPSZ ίϛοτ  OFX QBSTFSSLU UFTUSLU

    NPEJpFE TZOUBYSLU 8PSLJOH%JSFDUPSZʹϑΝΠϧΛ௥Ճɾฤू
  2. ࡞ۀͷྲྀΕ 8PSLJOH ࡞ۀσΟϨΫτϦ 4UBHJOH )JTUPSZ ίϛοτ  4UBHJOHͷ಺༰Λίϛοτ ཤྺʹొ࿥ 


    HJUDPNNJUNNFTTBHF OFX QBSTFSSLU UFTUSLU NPEJpFE TZOUBYSLU OFX QBSTFSSLU NPEJpFE TZOUBYSLU NFTTBHF IBTI OFX QBSTFSSLU NPEJpFE TZOUBYSLU
  3. ίϛοτ w 4UBHJOHͷ಺༰Λίϛοτͯ͠ཤྺʹొ࿥͢Δ
 $ git commit -m "<commit message>" w

    ίϛοτ࣌ʹ͸ϝοηʔδΛ෇Ճ͢Δ w มߋ಺༰Λॻ͍͓ͯ͘ͱޙͰ෼͔Γ΍͍͢ w ྫύʔαʔΛ࣮૷ w ྫҙຯղੳͰʙʙʙʹͳΔόάΛमਖ਼
  4. ཤྺͷӾཡ w ཤྺΛӾཡ͢Δ$ git log w ίϛοτͷҰཡ͕ϋογϡɾϝοηʔδɾ೔࣌ͳͲ ͱͱ΋ʹදࣔ͞ΕΔ w ͦΕͧΕͷίϛοτ͸ϋογϡ

    4)" Ͱ
 ҰҙʹಛఆͰ͖Δ
 ྫ5a00b5712a039bfea1e8055206ab697e3081247d w ΦϓγϣϯΛ෇Ճ͢Δͱ΋ͬͱ৭ʑݟΕΔ
  5. ࠩ෼ͷӾཡ w ࠷ޙͷίϛοτͱ8PSLJOHͷࠩ෼
 $ git diff w ࠷ޙͷίϛοτͱ4UBHJOHͷࠩ෼
 $ git

    diff --cached w ͋Δίϛοτ"ͱ͋Δίϛοτ#ͷࠩ෼
 $ git diff <commit A>...<commit B>
  6. ίϛοτͷ࡟আ w ͋Δίϛοτ·Ͱ࡟আ͢Δ
 8PSLJOH%JS͸ͦͷ·· 
 $ git reset --soft w

    ͋Δίϛοτ·Ͱ࡟আ͢Δ
 8PSLJOH%JS΋ॻ͖׵͑Δ 
 $ git reset --hard
  7. • man git / git help <subcommand> w IUUQTHJUTDNDPNEPD w

    IUUQTUSBJOJOHHJUIVCDPNSFTPVSDFT ͞Βʹৄ͘͠