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

tigとかaliasなし生活を送ってみて改めてgitを覚えてる話

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

 tigとかaliasなし生活を送ってみて改めてgitを覚えてる話

Avatar for vividmuimui

vividmuimui

August 01, 2018
Tweet

More Decks by vividmuimui

Other Decks in Programming

Transcript

  1. 目次 目次 add -u reset –mixed, –soft, –hard show HEAD~^2~~^~^2

    HEAD, @ –staged is a synonym of –cached di topic..master/topic…master 4
  2. add -u add -u 対象となるファイルは と一緒です。 や しか知らなかったので地味に便利かなと思っています。 は少し躊躇するし、 や

    などでコンフリクトしてコ ンフリクト解消したときとかにも便利そう( 予感) https://git-scm.com/docs/git-add -u, --update update tracked files 5
  3. reset –mixed, –soft, –hard reset –mixed, –soft, –hard 今回改めて覚えるまで、 デフォルトのオプションがどれかもよくわかってなかったし、

    しか普 段使ってなかったので、 と の違いもよくわかったなかったでした。 https://git-scm.com/docs/git-reset 6
  4. reset –mixed, –soft, –hard reset –mixed, –soft, –hard デフォルトは と

    どちらかわかりますか? と の違いを理解できますか? 7
  5. reset –mixed, –soft, –hard reset –mixed, –soft, –hard 詳しくは この記事

    を! http://d.hatena.ne.jp/murank/20110327/1301224770 --soft --mixed( 同等) --hard 影響度 小 順 以下 --soft HEAD 位置 変更 影響 --mixed ( ) HEAD 位置 変更 影響 --hard HEAD 位置 変更 http://d.hatena.ne.jp/murank/20110327/1301224770 8
  6. show HEAD show HEAD ~ ( ) ~世代前 指定 ^

    ( ) 複数 親 指定 https://qiita.com/chihiro/items/d551c14cb9764454e0b9 9
  7. show HEAD show HEAD ^ ( ) 複数 親 指定

    https://qiita.com/chihiro/items/d551c14cb9764454e0b9 11
  8. HEAD, @ HEAD, @ ( ちなみに、1.8.5 は2013 年年末ごろにリリースされてます。) git のv1.8.5

    からは、大文字「HEAD 」の4 文字を打たな くて済むよう「@」というエイリアスが用意された http://tech.aainc.co.jp/archives/6740 Instead of typing four capital letters “HEAD”, you can say “@” now, e.g. “git log @”. https://raw.githubusercontent.com/git/git/master/Documentation/RelNotes 13
  9. –staged is a synonym of –cached –staged is a synonym

    of –cached よりも のほうが絶対理解しやすいはず。 ( なんでcached という名前なのか、は理解してないです ) https://git-scm.com/docs/git-di git diff --cached git diff --staged 15
  10. git diff foo..bar git diff foo bar 完全 同 2

    foo bar 最新 変更同士 違 表示 一方 git diff foo...bar 2 bar 最新 変更 違 表示 通常 2 間 共通 最後 https://yakst.com/ja/posts/4116 18