LoginSignup
5
6

More than 5 years have passed since last update.

Tig を使い始めてみた

Posted at

tig を使い始めてみた

tig が便利とのことなので使い始めてみました
* https://github.com/jonas/tig

tig とは

テキストベースの Git クライアントです

refs-view:
tig.jpg

install

mac 環境であれば brew install するだけ

$ brew install tig

それ以外の方は以下を参考にしてください
* https://github.com/jonas/tig/blob/master/INSTALL.adoc

起動と基本操作

ターミナルで tig を起動

起動後はメイン画面: main-view にいます

ここから、git 操作にあわせてビューを切り替えていきます

  m view-main         Show main view
  d view-diff         Show diff view
  l view-log          Show log view
  ...
  h view-help         Show help view

あとは、開いているビューモードにあわせてコマンドを実行
h キーでヘルプページが開くので、操作わからなかったら開いて確認

.tigrc でカスタマイズ

細かい表示設定やキーバインドなどは .tigrc で設定可能

晒しておきます

# Set Variables
set refs-view = date:local author:false id ref:true commit-title:true

# Set Key Bind
bind generic F none
bind generic F !git fetch

bind status + !git commit --amend
bind status S @git stash

bind refs n @git branch "%(prompt Enter branch name: )" %(remote)
bind refs R @git rebase -i %(branch)
bind refs ! ?git branch -D %(branch)

詳細は以下のページを参考
* http://jonas.nitro.dk/tig/tigrc.5.html

使ってみて

ちょっと長いコマンドや、ブランチ名のコピペから開放されてよかった。また、ログまわりなど通常のコマンドよりカラーリングされ見やすかったですね。

ただ、色々参考にしているうちに zshpeco の環境を気に入ってしまったので、そちらに移行予定です

5
6
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
5
6