{"id":13529865,"url":"https://github.com/arl/gitmux","last_synced_at":"2025-05-15T10:06:42.371Z","repository":{"id":35902966,"uuid":"217990741","full_name":"arl/gitmux","owner":"arl","description":":computer: Git in your tmux status bar","archived":false,"fork":false,"pushed_at":"2025-02-19T19:51:08.000Z","size":1697,"stargazers_count":658,"open_issues_count":12,"forks_count":24,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T16:57:19.256Z","etag":null,"topics":["bash","cli","fish","git","tmux","tmux-status","zsh"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["arl"]}},"created_at":"2019-10-28T07:38:40.000Z","updated_at":"2025-04-03T14:57:36.000Z","dependencies_parsed_at":"2024-01-10T20:50:33.693Z","dependency_job_id":"4986f83a-5e36-4322-861a-1c008cdcb8da","html_url":"https://github.com/arl/gitmux","commit_stats":{"total_commits":72,"total_committers":11,"mean_commits":6.545454545454546,"dds":"0.36111111111111116","last_synced_commit":"b821624bad63861f762a001bb4287861912f7c39"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arl%2Fgitmux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arl%2Fgitmux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arl%2Fgitmux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arl%2Fgitmux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arl","download_url":"https://codeload.github.com/arl/gitmux/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254319719,"owners_count":22051073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cli","fish","git","tmux","tmux-status","zsh"],"created_at":"2024-08-01T07:00:40.137Z","updated_at":"2025-05-15T10:06:37.348Z","avatar_url":"https://github.com/arl.png","language":"Go","readme":"\u003cp align=\"center\"\u003e\n\u003cimg width=\"50%\" height=\"50%\" src=\"https://github.com/arl/gitmux/raw/readme-images/logo-transparent.png\" /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003eGitmux shows git status in your tmux status bar\u003c/p\u003e\n\u003chr\u003e\n\n\u003cp align=\"center\"\u003e\n\n\u003ca href=\"https://github.com/arl/gitmux/actions/workflows/ci-cd.yaml\"\u003e\n  \u003cimg alt=\"tests\" src=\"https://github.com/arl/gitmux/actions/workflows/ci-cd.yaml/badge.svg\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://goreportcard.com/report/github.com/arl/gitmux\"\u003e\n  \u003cimg alt=\"goreport\" src=\"https://goreportcard.com/badge/github.com/arl/gitmux\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" /\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n![demo](https://raw.githubusercontent.com/arl/gitmux/readme-images/demo-small.gif)\n\n\n - **easy**. Install and forget about it\n - **minimal**. Just shows what you need, when you need it\n - **discrete**. Get out of your way if current directory is not in a Git tree\n - **shell-agnostic**. Does not rely on shell-features so works with all of them\n - **customizable**. Colors, symbols and layout are configurable\n\n---\n\n- [Prerequisites](#prerequisites)\n- [Installing](#installing)\n  - [Binary release](#binary-release)\n  - [Homebrew tap (macOS and linux) (amd64 and arm64)](#homebrew-tap-macos-and-linux-amd64-and-arm64)\n  - [AUR](#aur)\n  - [From source](#from-source)\n- [Getting started](#getting-started)\n- [Customizing](#customizing)\n  - [Symbols](#symbols)\n  - [Styles](#styles)\n  - [Layout components](#layout-components)\n  - [Additional options](#additional-options)\n- [Troubleshooting](#troubleshooting)\n  - [Gitmux takes too long to refresh?](#gitmux-takes-too-long-to-refresh)\n- [Contributing](#contributing)\n- [License: MIT](#license-mit)\n\n\n\n## Prerequisites\n\nWorks with all reasonably recent [tmux](https://github.com/tmux/tmux) versions (2.1+)\n\n## Installing\n\n### Binary release\n\n[Download the latest](https://github.com/arl/gitmux/releases/latest) binary for your platform/architecture and uncompress it.\n\n\n### Homebrew tap (macOS and linux) (amd64 and arm64)\n\nInstall the latest version with:\n\n    brew tap arl/arl\n    brew install gitmux\n\n### AUR\n\nArch Linux users can download the [gitmux](https://aur.archlinux.org/packages/gitmux), [gitmux-bin](https://aur.archlinux.org/packages/gitmux-bin) or [gitmux-git](https://aur.archlinux.org/packages/gitmux-git) AUR package.\n\n### From source\n\n[Download and install a Go compiler](https://golang.org/dl/) (Go 1.16 or later).\nRun `go install` to build and install `gitmux`:\n\n    go install github.com/arl/gitmux@latest\n\n## Getting started\n\nIf your `tmux` version supports `pane_current_path` (tmux v2.1+),\njust add this line to your `.tmux.conf`:\n\n    set -g status-right '#(gitmux \"#{pane_current_path}\")'\n\nIf your `tmux` doesn't support `pane_current_path` then you can use \na [bash-specific solution](https://github.com/arl/gitmux/issues/19#issuecomment-594735939)\nto achieve relatively similar behaviour: `gitmux` will refresh after every shell command \nyou run or when you switch windows, however it won't refresh automatically, nor when switching panes.  \n\nNote that `tmux v2.1` was released in 2015 so you're probably better off updating to a more recent version anyway 🙂.\n\n## Customizing\n\n`gitmux` output can be customized via a configuration file in YAML format.\n\nThis is the default gitmux configuration file, in YAML format:\n\n```yaml\ntmux:\n    symbols:\n        branch: '⎇ '\n        hashprefix: ':'\n        ahead: ↑·\n        behind: ↓·\n        staged: '● '\n        conflict: '✖ '\n        modified: '✚ '\n        untracked: '… '\n        stashed: '⚑ '\n        clean: ✔\n        insertions: Σ\n        deletions: Δ\n    styles:\n        clear: '#[fg=default]'\n        state: '#[fg=red,bold]'\n        branch: '#[fg=white,bold]'\n        remote: '#[fg=cyan]'\n        divergence: '#[fg=default]'\n        staged: '#[fg=green,bold]'\n        conflict: '#[fg=red,bold]'\n        modified: '#[fg=red,bold]'\n        untracked: '#[fg=magenta,bold]'\n        stashed: '#[fg=cyan,bold]'\n        clean: '#[fg=green,bold]'\n        insertions: '#[fg=green]'\n        deletions: '#[fg=red]'\n    layout: [branch, .., remote-branch, divergence, '- ', flags]\n    options:\n        branch_max_len: 0\n        branch_trim: right\n        ellipsis: …\n        hide_clean: false\n        swap_divergence: false\n        divergence_space: false\n```\n\nFirst, save the default configuration to a new file:\n\n    gitmux -printcfg \u003e $HOME/.gitmux.conf\n\nModify the line you've added to `.tmux.conf`, passing the path of the configuration file as argument to `gitmux` via the `-cfg` flag\n\n    set -g status-right '#(gitmux -cfg $HOME/.gitmux.conf \"#{pane_current_path}\")'\n\nOpen `.gitmux.conf` and modify it, replacing symbols, styles and layout to suit your needs.\n\nIn `tmux` status bar, `gitmux` output immediately reflects the changes you make to the configuration.\n\n`gitmux` configuration is split into 4 sections:\n - `symbols`: they're just strings of unicode characters\n - `styles`: tmux format strings\n - `layout`: list of `gitmux` layout components, defines the component to show and in their order.\n - `options`: additional configuration options\n\n\n### Symbols\n\nThe `symbols` section defines the symbols printed before specific elements\nof Git status displayed in `tmux` status string:\n\n```yaml\n  symbols:\n        branch: \"⎇ \"    # current branch name.\n        hashprefix: \":\"  # Git SHA1 hash (in 'detached' state).\n        ahead: ↑·        # 'ahead count' when local and remote branch diverged.\n        behind: ↓·       # 'behind count' when local and remote branch diverged.\n        staged: \"● \"     # count of files in the staging area.\n        conflict: \"✖ \"   # count of files in conflicts.\n        modified: \"✚ \"   # count of modified files.\n        untracked: \"… \"  # count of untracked files.\n        stashed: \"⚑ \"    # count of stash entries.\n        insertions: Σ    # count of inserted lines (stats section).\n        deletions: Δ     # count of deleted lines (stats section).\n        clean: ✔         # Shown when the working tree is clean.\n```\n\n\n### Styles\n\nStyles are tmux format strings used to specify text colors and attributes of Git\nstatus elements.\nSee the [`STYLES` section](https://man7.org/linux/man-pages/man1/tmux.1.html#STYLES) of `tmux` man page.\n\n```yaml\n  styles:\n    clear: '#[fg=default]'          # Clear previous style.\n    state: '#[fg=red,bold]'         # Special tree state strings such as [rebase], [merge], etc.\n    branch: '#[fg=white,bold]'      # Local branch name\n    remote: '#[fg=cyan]'            # Remote branch name\n    divergence: \"#[fg=yellow]\"      # 'divergence' counts\n    staged: '#[fg=green,bold]'      # 'staged' count\n    conflict: '#[fg=red,bold]'      # 'conflicts' count\n    modified: '#[fg=red,bold]'      # 'modified' count\n    untracked: '#[fg=magenta,bold]' # 'untracked' count\n    stashed: '#[fg=cyan,bold]'      # 'stash' count\n    insertions: '#[fg=green]'       # 'insertions' count\n    deletions: '#[fg=red]'          # 'deletions' count\n    clean: '#[fg=green,bold]'       # 'clean' symbol\n```\n\n### Layout components\n\nThe `layout` section defines what components `gitmux` shows and the order in which\nthey appear on `tmux` status bar.\n\n\nFor example, the default `gitmux` layout shows is:\n\n```yaml\nlayout: [branch, .., remote-branch, divergence, \" - \", flags]\n```\n\nIt shows, in that order:\n - the local branch name,\n - 2 dots characters `..`,\n - the remote branch name\n - the local/remote divergence\n - a `-` character\n - and finally the flags representing the working tree state\n\nNote that elements only appear when they make sense, for example if local and\nremote branch are aligned, the divergence string won't show up. Same thing for\nthe remote branch, etc.\n\nBut you can anyway choose to never show some components if you wish, or to present\nthem in a different order.\n\nThis is the list of the possible keywords for `layout`:\n\n| Layout keywords  | Description                                        |       Example        |\n| :--------------: | :------------------------------------------------- | :------------------: |\n|     `branch`     | local branch name                                  |        `main`        |\n| `remote-branch`  | remote branch name                                 |    `origin/main`     |\n|   `divergence`   | divergence local/remote branch, if any             |       `↓·2↑·1`       |\n|     `remote`     | alias for `remote-branch` followed by `divergence` | `origin/main ↓·2↑·1` |\n|     `flags`      | Symbols representing the working tree state        |    `✚ 1 ⚑ 1 … 2`     |\n|     `stats`      | Insertions/deletions (lines). Disabled by default  |      `Σ56 Δ21`       |\n| any string `foo` | Non-keywords are shown as-is                       |    `hello gitmux`    |\n\n\nSome example layouts:\n\n - default layout:\n\n```yaml\nlayout: [branch, .., remote-branch, divergence, \" - \", flags]\n```\n\n - some examples layouts:\n\n```yaml\nlayout: [branch, divergence, \" - \", flags]\n```\n```yaml\nlayout: [flags, \" \", branch]\n```\n```yaml\nlayout: [branch, \"|\", flags, \"|\", stats]\n```\n\n\n### Additional options\n\nThis is the list of additional configuration `options`:\n\n| Option             | Description                                                                     |      Default       |\n| :----------------- | :------------------------------------------------------------------------------ | :----------------: |\n| `branch_max_len`   | Maximum displayed length for local and remote branch names                      |   `0` (no limit)   |\n| `branch_trim`      | Trim left, right or from the center of the branch (`right`, `left` or `center`) | `right` (trailing) |\n| `ellipsis`         | Character to show branch name has been truncated                                |        `…`         |\n| `hide_clean`       | Hides the clean flag entirely                                                   |      `false`       |\n| `swap_divergence`  | Swaps order of behind \u0026 ahead upstream counts                                   |      `false`       |\n| `divergence_space` | Add a space between behind \u0026 ahead upstream counts                              |      `false`       |\n\n## Troubleshooting\n\nCheck the opened and closed issues and don't hesitate to report anything by [filing a new one](https://github.com/arl/gitmux/issues/new). \n\n\n### Gitmux takes too long to refresh?\n\nIn case gitmux takes too long to refresh, try to decrease the value of the `status-interval` option.\nA reasonable value is 2 seconds, which you can set in `.tmux.conf` with:\n\n    set -g status-interval 2\n\nCheck out [tmux man page](https://www.man7.org/linux/man-pages/man1/tmux.1.html#OPTIONS) for more details.\n\n\n## Contributing\n\nPull requests are welcome.  \nFor major changes, please open an issue first to open a discussion.\n\n\n## License: [MIT](./LICENSE)\n","funding_links":["https://github.com/sponsors/arl"],"categories":["Go","Command-Line Productivity","Status Bar"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farl%2Fgitmux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farl%2Fgitmux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farl%2Fgitmux/lists"}