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

GitのCLI操作を楽にするためにエイリアスを作った話

 GitのCLI操作を楽にするためにエイリアスを作った話

Daiki Nojiri

January 23, 2020
Tweet

More Decks by Daiki Nojiri

Other Decks in Programming

Transcript

  1. ΤΠϦΞεΛ࡞Δʹ͸ શϢʔβͰ࢖͑ΔΑ͏ʹ͢Δ $ git config --system alias.co checkout ࠓͷϢʔβ͚ͩͰ࢖͑ΔΑ͏ʹ͢Δ $

    git config --global alias.co checkout ࠓͷϦϙδτϦ͚ͩͰ࢖͑ΔΑ͏ʹ͢Δ $ git config alias.co checkout
  2. ͍Ζ͍Ζ࡞ͬͯ·͢ [alias] a = add s = status b =

    branch f = fetch cm = commit co = checkout st = stash stp = stash pop pushh = push origin HEAD pushf = push -f origin HEAD pulll = pull origin HEAD undo = reset --soft HEAD~ redo = commit -c ORIG_HEAD ~/.gitconfig
  3. ΤΠϦΞεΛ࡞Δํ๏ bash $ alias co='git checkout' >> ~/.bashrc $ source

    ~/.bashrc zsh $ alias co='git checkout' >> ~/.zshrc $ source ~/.zshrc fish $ alias co='git checkout’
  4. ͜Ε΋͍Ζ͍Ζ࡞ͬͯ·͢ alias s='git status' alias b='git branch' alias cm='git commit'

    alias co='git checkout' alias st='git stash' alias stp='git stash pop' alias pulll='git pull origin HEAD' alias pushh='git push origin HEAD' alias undo='git reset --soft HEAD~' alias redo='git reset -c ORIG_HEAD' ~/.config/fish/fish.config
  5. ϒϥϯν໊Λଧͭͷ͕ΊΜͲ͍͘͞ $ git branch add-manual-operation-for-ranking add-test-customer * develop fix/series-create $

    co add-manual-operation-for-ranking $ co add-test-customer $ co fix-series-creation