Skip to main content

Visualize git history as per-machine tunnels in your terminal

Project description

git-tunnel

Visualize your git history as per-machine tunnels in the terminal.

If you work across multiple machines like me — a MacBook, a Workstation, a Server — git log treats them all the same which can be very annoying at some points. git-tunnel splits each machine into its own colored column so you can see at a glance where every commit was made.

────────────────────────────────────────────────────────────────────────────────
  TIME              │ pre git-tunnel                       │ MacBook                              │ Workstation                          │ HASH
────────────────────────────────────────────────────────────────────────────────
  2 hours ago       │ · · · · · · · · · · · · · ·          │ WIP: invoice route                   │ · · · · · · · · · · · · · ·          │ 2c4930f
  3 hours ago       │ · · · · · · · · · · · · · ·          │ · · · · · · · · · · · · · ·          │ finished validation                  │ 6f46c9f
  1 day ago         │ added model                          │ · · · · · · · · · · · · · ·          │ · · · · · · · · · · · · · ·          │ fd7bcad
  1 day ago         │ initial setup                        │ · · · · · · · · · · · · · ·          │ · · · · · · · · · · · · · ·          │ f3bc95b
────────────────────────────────────────────────────────────────────────────────

  ■ pre git-tunnel   ■ MacBook   ■ Workstation

Commits made before git-tunnel was installed appear in a plain white pre git-tunnel column — no history rewriting, no warnings.


Install

The recommended way to install git-tunnel is with pipx or uv — both install it into an isolated environment and expose the git-tunnel command globally. This avoids the externally-managed-environment error you get with bare pip on Ubuntu 23.04+ and other modern Linux distros.

pipx (recommended for most users):

pipx install git-tunnel

uv (if you already use uv):

uv tool install git-tunnel

pip (virtualenv or older systems only):

pip install git-tunnel

On Ubuntu 23.04+, Debian 12+, and similar distros, using pip install system-wide will likely fail with an externally-managed-environment error. Use pipx or uv tool install instead.

Don't have pipx? Install it first:

# Ubuntu / Debian
sudo apt install pipx
pipx ensurepath

# macOS
brew install pipx
pipx ensurepath

Install (once per machine)

Run the interactive install:

git-tunnel install

This will:

  • Ask for a device name (e.g. MacBook, Workstation, Server)
  • Set git config --global user.device
  • Install the prepare-commit-msg hook globally
  • Point git config --global core.hooksPath at the hook

From this point on, every commit you make will automatically get a [device:YourDevice] tag appended to the message — silently, without you doing anything.


Usage

Inside any git repo:

# Compact view (messages truncated)
git-tunnel

# Full view (complete commit messages)
git-tunnel --all

Not sure what's available? Run:

git-tunnel --help

How it works

git-tunnel uses a global prepare-commit-msg hook that appends a [device:X] tag to every commit message, where X comes from git config --global user.device.

Your user.name is never touched — it stays clean for collaboration. The device tag lives in the commit message body and is stripped from the display in the tunnel view.


Multiple machines

Set a different device name on each machine:

# MacBook
git-tunnel install  # enter "MacBook" when prompted

# Workstation
git-tunnel install  # enter "Workstation" when prompted

# Server
git-tunnel install  # enter "Server" when prompted

Since the hook is global, it applies to every repo on that machine automatically.


Zero dependencies

git-tunnel uses only the Python standard library and git itself. No third-party packages required.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_tunnel-0.1.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_tunnel-0.1.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file git_tunnel-0.1.2.tar.gz.

File metadata

  • Download URL: git_tunnel-0.1.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for git_tunnel-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2caef67475d8bdeef90f690cc297981c95e88f13223f8fb18d4d9aead203ca71
MD5 be5320bdda530a1b66bf9dc6cbd3a96f
BLAKE2b-256 e33a0adcef0f5df5a8d02a68e73bfb48025f97b9fe6ba1132135624dd6b9ba85

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_tunnel-0.1.2.tar.gz:

Publisher: publish.yml on YounesHB92/git-tunnel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file git_tunnel-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: git_tunnel-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for git_tunnel-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6a857ab122352921169236d289058e1521c1a045d849078791bbe2a866ec39ce
MD5 8f5117fdae22eb5565e88cdd2ccc9149
BLAKE2b-256 6357a9f44dc4644ec401e9b498462f6e54e4e328a20c8639d3d74f3ba7d1ce82

See more details on using hashes here.

Provenance

The following attestation bundles were made for git_tunnel-0.1.2-py3-none-any.whl:

Publisher: publish.yml on YounesHB92/git-tunnel

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page