0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gitコマンド入力時に入力の補完を行う

Last updated at Posted at 2018-06-07

Why

gitコマンドを操作する際に、状態の確認の手間を省き、間違って別のブランチへの操作を防ぎたい

How

gitのプロンプトに各種追加情報を表示可能にするスクリプトを導入する

条件

bashを利用している(zshについては割愛)

既にXcodeなどでインストールされている場合もあるので、検索をすることをお勧めします。
$ find / -name "git-completion.bash" -print

見つからない場合はダウンロードする
https://github.com/git/git/blob/master/contrib/completion/git-completion.bash

下記コマンドで.bashrcに反映

$ echo "source /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash" >> ~/.bashrc
$ . ~/.bashrc
0
4
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
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?