Zshμλ Gitμ© ν μλμμ± μ€ν¬λ¦½νΈκ° λ€μ΄ μλ€.
.zshrc νμΌμμ λ¨μν autoload -Uz compinit && compinit λͺ
λ Ήμ μ€ννλ©΄ λλ€.
Zshμ Bashλ³΄λ€ λ κ°λ ₯νλ€.
$ git che<tab>
check-attr -- display gitattributes information
check-ref-format -- ensure that a reference name is well formed
checkout -- checkout branch or paths to working tree
checkout-index -- copy files from index to working directory
cherry -- find commits not merged upstream
cherry-pick -- apply changes introduced by some existing commitsZshμ μ νμ§κ° μ¬λ¬ κ°μΌ λ λ¨μν μ΄λ¦λ§ 보μ¬μ£Όμ§ μλλ€. κ°λ¨ν μ€λͺ λ ν¨κ» 보μ¬μ£Όκ³ ν ν€λ‘ κ³ λ₯Ό μ μλ€. Git λͺ λ Ήμ΄λ§μ΄ μλλΌ μκ·λ¨ΌνΈλ μλμμ±ν΄μ€λ€. κ²λ€κ° μ μ₯μμ 리λͺ¨νΈλ Refs μ΄λ¦κ³Ό νμΌ μ΄λ¦ κ°μ κ²λ μλμμ±νλ€. Zshμ μλ λͺ¨λ κ²μ μ μνλ€.
Zshμλ vcs_info λΌλ νλ μμν¬κ° ν¬ν¨λΌ μλ€. μ¬κΈ°μλ νμ¬ μ¬μ©νλ VCSμ λ³΄κ° λ€μ΄μλ€.
~/.zshrc νμΌμ μλ λΌμΈμ μΆκ°νλ©΄ μ€λ₯Έμͺ½ ν둬ννΈμ λΈλμΉ μ΄λ¦μ΄ νμλλ€.
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
RPROMPT=\$vcs_info_msg_0_
# PROMPT=\$vcs_info_msg_0_'%# '
zstyle ':vcs_info:git:*' formats '%b'μμμ Git μ μ₯μ λλ ν λ¦¬λ‘ μ΄λνλ©΄ ν°λ―Έλ μ€λ₯Έμͺ½μ ν λΈλμΉ μ΄λ¦μ μλμ κ°μ΄ 보μ¬μ€λ€. (λ¬Όλ‘ μ£Όμ μ²λ¦¬ν κ²λ§ λ리면 μΌμͺ½ ν둬ννΈμμλ μ λλ€.)
vcs_infoμ λν μμΈν μ 보λ zshcontrib(1) λ©λ΄μΌ νμ΄μ§λ₯Ό 보거λ
http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Version-Control-Informationμμ νμΈνλ€.
vcs_infoλ§κ³ Gitμ λ€μ΄ μλ git-prompt.sh λ₯Ό μ§μ μμ ν΄μ μ¬μ©ν΄λ λλ€. μμΈν λ΄μ©μ https://github.com/git/git/blob/master/contrib/completion/git-prompt.shμμ νμΈνλ€.
git-prompt.sh λ Bashμ Zsh λͺ¨λ νΈνλλ€.
Zshμ κ°λ Ήν¨μ μ΄λμ΄ λ΄λ νλ μμν¬κ° μλ€. "oh-my-zsh"μ΄ λνμ μΈλ° https://github.com/robbyrussell/oh-my-zshμμ μ°Ύμ μ μλ€. Git ν μλμμ±λ "oh-my-zsh" νλ¬κ·ΈμΈμ μ¬μ©νλ©΄ λκ³ λΈλμΉ μ΄μμ μ 보λ₯Ό 보μ¬μ£Όλ λ€μν ν둬ννΈ ν λ§λ μ 곡νλ€. oh-my-zsh ν λ§.μ ν둬ννΈ ν λ§λ₯Ό μ μ©ν λͺ¨μ΅μ΄λ€.

