토막숏 폼 블로그

git auto completion on Mac

  1. 시작하기 전에 git은 최신 버전으로

    brew install git
    
  2. 스크립트 다운로드

    curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
    
  3. ~/.bash_profile에 아래 문구 추가

    if [ -f ~/.git-completion.bash ]; then
      . ~/.git-completion.bash
    fi
    
  4. 터미널 재시작

만약 터미널 실행 시 complete:13: command not found: compdef가 뜬다면

~/.zshrc에 아래 문구 추가

autoload -Uz compinit
compinit

ref

  1. https://apple.stackexchange.com/questions/55875/git-auto-complete-for-branches-at-the-command-line
  2. https://apple.stackexchange.com/questions/296477/my-command-line-says-complete13-command-not-found-compdef

당겨서 다음 글 보기

프로필 사진

작성자

0