15
11

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で管理しているファイルをTree表示する

Posted at

Gitで管理されているファイルを参照する方法としてgit ls-filesがあるが、ディレクトリ構造がわかりにくく始めて見るレポジトリなどでは全体が把握しにくいことがありました。
でも、いっぽうでtreeコマンドは管理対象外のファイルも表示されてしまうのでGitで管理されているファイルだけをTree表示するgit-treeなるものを作りました。
はじめてのPyPiへの登録だったのでいろいろ不具合等があるかもしれませんが何かあればコメントください。

##Install
PyPiに登録されているのでpipまたはeasy_installを使ってインストール

$ pip install git-tree

##使い方
コマンド名をgit-treeとしているので、Gitのコマンドのようにgit treeとしても実行できます。

$ git-tree

or

$ git tree

##Demo
実際実行してみると下記のようになる。
さらに下に表示したgit ls-filesよりはディレクトリ構造がわかりやすいはず…?

##git-tree
ディレクトリや実行ファイルなどには色がつくようにしています。
また、ディレクトリにはindicatorとして/が末尾につくようにしています。
これらはそのうちコマンドラインオプションにでも仕様かと考えています。

git-tree.png

##比較 git ls-files
ls-filesのほうがコンパクトでいいっちゃいいんですけどね。
ls-files.png

Link

15
11
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
15
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?