0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

M1MacBookのgitに補完機能を導入する

Last updated at Posted at 2023-11-30

git-completionsをM1MacBookに導入する

背景

  • 長いブランチ名を手入力するのって大変

環境

  • PC: M1MacBook
  • シェル: zsh
  • git: git version 2.42.0
  • Homebrew 4.1.22

方法

  • gitの保管をするためのスクリプトがここにある

  • 基本的にgit-completion.zshの指示に従う
  • 私の環境ではそもそもbashの補完機能を導入していなかったので、それもbrewを用いて導入する
  • source ~/.zshrcで再読み込みを行ったが、うまくいかなかった
  • git-completion.bashもインストールした
all.sh
cd ~
mkdir .zsh
cd .zsh
curl -o _git https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh
echo "fpath=(~/.zsh \$fpath)" >> ~/.zshrc
brew install bash-completion
source ~/.zshrc
# error

curl -O https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
source ~/.zshrc

# `$ git chec`などとすると補完が効くはず

参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?