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

秘伝の `gitconfig`

to4iki
June 15, 2019

秘伝の `gitconfig`

to4iki

June 15, 2019
Tweet

More Decks by to4iki

Other Decks in Programming

Transcript

  1. ൿ఻ͷ gitconfig
    & ෇͚߹Θͤୡ
    2019.06.15
    # shinjukult
    @to4iki
    1

    View Slide

  2. About Me
    • Takezawa Toshiki
    • @to4iki
    • iOS/Swift 
    2

    View Slide

  3. Agenda
    1. ఱԼҰ gitconfig େձ
    2. tigΔ
    3. tips
    !
    3

    View Slide

  4. 1. ఱԼҰ gitconfig େձ
    4

    View Slide

  5. جຊํ਑:
    ͱʹ͔͘গͳ͍ίϚϯυͰ!
    5

    View Slide

  6. gitconfig
    https://github.com/to4iki/dotfiles/blob/master/git/gitconfig
    [alias]
    br = branch --verbose --verbose --color --sort=-authordate
    co = checkout
    c = commit -av
    d = diff --histogram
    f = fetch
    g = grep -n -p --color --heading --break
    l = log --oneline
    n = now --all --stat
    s = status -sb
    undo = reset --soft HEAD~
    o = browse
    copr = !git fetch origin pull/${1}/head:pr/${1} && git checkout pr/${1}
    fpush = push --force-with-lease
    6

    View Slide

  7. ҰจࣈΤΠϦΞε
    https://github.com/to4iki/dotfiles/blob/master/fish/config.fish
    alias git 'hub'
    alias g 'git'
    alias s 'git s'
    alias b 'git br'
    alias m 'git co master'
    alias d 'git d'
    alias gg 'git g'
    alias t 'tig'
    alias ta 'tig --all'
    7

    View Slide

  8. 2. tigΔ
    8

    View Slide

  9. Tig - text-mode interface for git
    https://github.com/jonas/tig
    9

    View Slide

  10. tig
    • ৭ʑGUIͷgitΫϥΠΞϯτ࢖͚ͬͨͲɺϝΠϯ͸tig
    • ࠩ෼ݟ͍͚ͨ࣌ͩGUIΫϥΠΞϯτ࢖͏͜ͱ΋͋Δ
    • ଟ෼ͳΜͰ΋Ͱ͖Δ
    • CUIͳͷͰͦΓΌಈ࡞͸ૣ͍
    10

    View Slide

  11. tig ͷ
    ࢖༻ྫͷલʹɺ
    11

    View Slide

  12. hub
    https://hub.github.com/
    GitHubΛCUI͔Βѻ͏͜ͱ͕Ͱ͖Δ
    12

    View Slide

  13. whichpr
    https://github.com/pocke/whichpr
    commit hash ͔Β֘౰͢ΔPRΛ୳ࡧ͠ɺGitHub্ͷϖʔδΛදࣔ͢Δ
    13

    View Slide

  14. tigrc
    https://github.com/to4iki/dotfiles/blob/master/etc/tigrc
    # Alias
    ...
    bind generic y @sh -c "echo %(commit) | pbcopy"
    bind main B [email protected] browse -- commit/%(commit)
    bind status B [email protected] browse -- blob/master/%(file)
    bind main D [email protected] compare %(commit)...%(branch)
    bind refs D [email protected] compare master...%(branch)
    bind main P [email protected] open %(commit)
    bind blame P [email protected] open %(commit)
    bind main R !git rebase -i %(commit)
    14

    View Slide

  15. 3. tips
    15

    View Slide

  16. pecoselectghq_repository
    https://github.com/yoshiori/fish-pecoselectghq_repository
    • cloneͨ͠ϦϙδτϦͷΠϯΫϦϝϯλϧαʔν
    16

    View Slide

  17. fishpecoselect_branch
    https://github.com/to4iki/fishpecoselect_branch
    • ϩʔΧϧʹ࡞੒ͨ͠branchͷΠϯΫϦϝϯλϧαʔν
    17

    View Slide

  18. git-update
    https://github.com/to4iki/dotfiles/blob/master/bin/git-update
    git checkout master
    git pull --ff
    git checkout topic_branch
    git rebase master
    ΛҰൃͰߦ͏αϒίϚϯυ
    18

    View Slide

  19. git-now
    https://github.com/iwata/git-now
    19

    View Slide

  20. Recap
    • Ҏલ͸΋ͬͱΰϦΰϦ͕ͩͬͨɺ3,4೥͔͚ͯચ࿅͞Ε͖ͯͨ
    • 1จࣈΤΠϦΞε͍͍ͧ
    20

    View Slide

  21. ࣗ෼͚ͩͷൿ఻ͷ
    gitconfig Λҭͯɺ
    ެ։͍ͯ͜͠͏ʂ
    21

    View Slide

  22. Thanks
    22

    View Slide