git-status-tree (https://github.com/wteuber/git-status-tree) is a command line tool that
helps you keeping track of changes in your git repository. Similar to the tree command
(https://github.com/nodakai/tree-command), git-status-tree recursively lists directories
and files. Run git tree in the command line to list all files in your git repository that are
untracked (?), have been added (A), modified (M), deleted (D), or renamed (R). The colored output
shows whether a file has been added/staged (green)(+) or not (red). The current status
of each file is appended to it. For renamed files, the tree structure shows the original
location with an arrow pointing to the new name or path.
See CHANGELOG.md for a list of changes between versions.
git-status-tree is available on rubygems.org. Install git-status-tree by running:
gem install git-status-tree
Start using git-status-tree in your terminal by running:
git tree
-i, --indent INDENT Set indentation (2-10 spaces)
-c, --collapse Collapse directories containing only another directory
-u, --untracked-files Show untracked files in new directories
-v, --version Show version
-h, --help Show help message
Note: Due to how git handles aliases, when using git tree --help, git will show the alias expansion instead of the help message. Use git tree -h to see the help message.
git-status-tree supports:
- Git (http://git-scm.com): version 1.8+
- Ruby (http://www.ruby-lang.org): version 2.6+
Ruby 2.6 is the support floor because it is the stock Ruby shipped with macOS,
so git-status-tree runs out of the box without installing a newer Ruby. The
runtime uses only the standard library (no gem dependencies), and RuboCop's
TargetRubyVersion is pinned to 2.6 to flag any syntax or APIs newer than 2.6
before they reach a user on system Ruby. Newer Ruby versions (3.x, 4.x) are
fully supported as well.
Set the indentation as you like, default is 4.
git config --global status-tree.indent <indent>
Set whether to collapse directories by default, default is false.
git config --global status-tree.collapse <true|false>
gem install git-status-tree
git clone https://github.com/wteuber/git-status-tree.git
cd git-status-tree
echo "change" >> README.md
echo "add untracked" > test/untracked.txt
rm DELETEME.txt
git add DELETEME.txt
echo "add staged" > test/staged.txt
git add test/staged.txt
git mv lib/version.rb lib/git_tree_version.rb
git mv test/node/test_node_class.rb test/node_class_test.rb
git tree
.
├── lib
│ └── version.rb -> git_tree_version.rb (R+)
├── test
│ ├── node
│ │ └── test_node_class.rb -> test/node_class_test.rb (R+)
│ ├── staged.txt (A+)
│ └── untracked.txt (?)
├── DELETEME.txt (D+)
└── README.md (M)
git tree -ci 2
.
├ lib/version.rb -> git_tree_version.rb (R+)
├ test
│ ├ node/test_node_class.rb -> test/node_class_test.rb (R+)
│ ├ staged.txt (A+)
│ └ untracked.txt (?)
├ DELETEME.txt (D+)
└ README.md (M)
# reset repo
git reset HEAD --hard
git clean -xdf
gem uninstall git-status-tree
- Clone this repository
git clone https://github.com/wteuber/git-status-tree.gitcd git-status-tree
- Install dependencies
bundle install
- Run tests
rake- Run all tests and RuboCop checks (default)rake test- Run all testsrake test:node- Run Node class tests onlyrake test:nodes_collection- Run NodesCollection tests onlyrake test:integration- Run integration testsruby test/coverage.rb- Run the suite with the coverage gate (what CI runs)- The suite runs on minitest (bundled with Ruby) and measures coverage with
the standard library's
coverageextension, so it needs no gem install and runs on every supported Ruby (2.6+). Tests require 100% library coverage.
- Run RuboCop separately (optional)
bundle exec rubocop- To auto-correct offenses:
bundle exec rubocop -a
- Run git-status-tree from repository
./bin/git-status-tree
- Build and install local gem
gem build git-status-tree.gemspecgem install git-status-tree-3.6.0.gem
- Push new version to rubygems (maintainers only)
gem push git-status-tree-3.6.0.gem