{"id":13438448,"url":"https://github.com/banga/git-split-diffs","last_synced_at":"2025-10-21T04:40:14.432Z","repository":{"id":37753317,"uuid":"356674026","full_name":"banga/git-split-diffs","owner":"banga","description":"Syntax highlighted side-by-side diffs in your terminal","archived":false,"fork":false,"pushed_at":"2024-01-05T01:29:44.000Z","size":51485,"stargazers_count":2546,"open_issues_count":7,"forks_count":42,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-04-17T02:31:58.488Z","etag":null,"topics":["diffs","difftool","git","github","split-diffs","syntax-highlighting","visual-studio-code"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/banga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2021-04-10T19:21:44.000Z","updated_at":"2024-04-16T11:00:15.000Z","dependencies_parsed_at":"2024-02-04T19:45:15.960Z","dependency_job_id":null,"html_url":"https://github.com/banga/git-split-diffs","commit_stats":{"total_commits":245,"total_committers":5,"mean_commits":49.0,"dds":0.04489795918367345,"last_synced_commit":"d65792e8d5efe9cccf108768e4a5a3226997a471"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banga%2Fgit-split-diffs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banga%2Fgit-split-diffs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banga%2Fgit-split-diffs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banga%2Fgit-split-diffs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/banga","download_url":"https://codeload.github.com/banga/git-split-diffs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244564780,"owners_count":20473128,"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":["diffs","difftool","git","github","split-diffs","syntax-highlighting","visual-studio-code"],"created_at":"2024-07-31T03:01:05.617Z","updated_at":"2025-10-21T04:40:09.410Z","avatar_url":"https://github.com/banga.png","language":"TypeScript","readme":"# git-split-diffs\n\nGitHub style split (side by side) diffs with syntax highlighting in your terminal.\n\n![Screenshot of dark theme](screenshots/dark.png?raw=true)\n\n![Screenshot of github-light theme](screenshots/github-light.png?raw=true)\n\n[Demo 1](https://asciinema.org/a/Bsk7CFtZkDZ4Ea89BwDcbD8LA) | [Demo 2](https://asciinema.org/a/7HrYqF2vjfrKXt28bv6BUAcym)\n\n## Usage\n\nThis currently requires `node` version 14 or newer to run.\n\n### Install globally\n\n```sh\nnpm install -g git-split-diffs\n\ngit config --global core.pager \"git-split-diffs --color | less -RFX\"\n```\n\n### Install locally\n\n```sh\nnpm install git-split-diffs\n\ngit config core.pager \"npx git-split-diffs --color | less -RFX\"\n```\n\n### Use manually\n\n```sh\ngit diff | git-split-diffs --color | less -RFX\n```\n\n## Customization\n\n### Line wrapping\n\nBy default, lines are wrapped to fit in the screen. If you prefer to truncate them, update the `wrap-lines` setting:\n\n```\ngit config split-diffs.wrap-lines false\n```\n\n### Inline changes\n\nBy default, salient changes within lines are also highlighted:\n![Screenshot of inline changes](screenshots/inline-changes.png?raw=true)\n\nYou can disable this with the `highlight-line-changes` setting:\n\n```\ngit config split-diffs.highlight-line-changes false\n```\n\n### Enable scrolling in the terminal\n\n```sh\ngit config --global core.pager \"git-split-diffs --color | less -+LFX\"\n```\n\n(note the difference from the main configuration with the added `+` to the `less` command)\n\n### Syntax highlighting\n\nSyntax highlighting is supported via [shiki](https://github.com/shikijs/shiki/), which uses the same grammars and themes as vscode. Each theme specifies a default syntax highlighting theme to use, which can be overridden by:\n\n```\ngit config split-diffs.syntax-highlighting-theme \u003cname\u003e\n```\n\nThe supported syntax highlighting themes are listed at https://github.com/shikijs/textmate-grammars-themes/tree/main/packages/tm-themes#tm-themes\n\nYou can disable syntax highlighting by setting the name to empty:\n\n```\ngit config split-diffs.syntax-highlighting-theme ''\n```\n\n### Narrow terminals\n\nSplit diffs can be hard to read on narrow terminals, so we revert to unified diffs if we cannot fit two lines of `min-line-width` on screen. This value is configurable:\n\n```\ngit config split-diffs.min-line-width 40\n```\n\nThis defaults to `80`, so screens below `160` characters will display unified diffs. Set it to `0` to always show split diffs.\n\n## Themes\n\nYou can pick between several [themes](themes/):\n\n### Arctic\n\nBased on https://www.nordtheme.com/\n\n```\ngit config split-diffs.theme-name arctic\n```\n\n![Screenshot of GitHub Dark (Dim) theme](screenshots/arctic.png?raw=true)\n\n### Dark\n\nThis is the default theme.\n\n```\ngit config split-diffs.theme-name dark\n```\n\n![Screenshot of dark theme](screenshots/dark.png?raw=true)\n\n### Light\n\n```\ngit config split-diffs.theme-name light\n```\n\n![Screenshot of light theme](screenshots/light.png?raw=true)\n\n### GitHub Dark (Dim)\n\n```\ngit config split-diffs.theme-name github-dark-dim\n```\n\n![Screenshot of GitHub Dark (Dim) theme](screenshots/github-dark-dim.png?raw=true)\n\n### GitHub Light\n\n```\ngit config split-diffs.theme-name github-light\n```\n\n![Screenshot of GitHub Light theme](screenshots/github-light.png?raw=true)\n\n### Solarized Dark\n\nAs seen on https://github.com/altercation/solarized\n\n```\ngit config split-diffs.theme-name solarized-dark\n```\n\n![Screenshot of Solarized Dark theme](screenshots/solarized-dark.png?raw=true)\n\n### Solarized Light\n\n```\ngit config split-diffs.theme-name solarized-light\n```\n\n![Screenshot of Solarized Light theme](screenshots/solarized-light.png?raw=true)\n\n### Monochrome Dark\n\n```\ngit config split-diffs.theme-name monochrome-dark\n```\n\n![Screenshot of Monochrome Dark theme](screenshots/monochrome-dark.png?raw=true)\n\n### Monochrome Light\n\n```\ngit config split-diffs.theme-name monochrome-light\n```\n\n![Screenshot of Monochrome Light theme](screenshots/monochrome-light.png?raw=true)\n\n## Custom Themes\n\nDefault themes are loaded from the `git-split-diffs` bundle. To load a custom theme, set `theme-directory` in git config and create a `{theme-name}.json` file in that directory with the theme's definition. You can use one of the existing themes in [themes/](https://github.com/banga/git-split-diffs/tree/main/themes) as a starting point.\n\n```\ngit config split-diffs.theme-directory \u003c/path/to/theme\u003e\ngit config split-diffs.theme-name \u003cname\u003e\n```\n\nThis will use `/path/to/theme/name.json` as the theme.\n\n## Performance\n\nTested by measuring the time it took to pipe the output `git log -p` to `/dev/null` via `git-split-diffs` with the default theme:\n\n| Features enabled                                      | ms/kloc |\n| ----------------------------------------------------- | ------- |\n| Everything                                            | 45      |\n| No syntax highlighting                                | 15      |\n| No syntax highlighting, no inline change highlighting | 13      |\n\n## Troubleshooting\n\n### Not seeing diffs side-by-side?\n\nSee [#narrow-terminals](#narrow-terminals)\n\n### Not seeing colors, or seeing fewer colors?\n\nText coloring is implemented using Chalk which supports [various levels of color](https://github.com/chalk/chalk#supportscolor). If Chalk is producing fewer colors than your terminal supports, try overriding Chalk's detection using a variation of the `--color` flag, e.g. `--color=16m` for true color. See Chalk's documentation or [this useful gist on terminal support](https://gist.github.com/XVilka/8346728) if issues persist.\n\n### Want to remove background colors from a theme?\n\nSee [#custom-themes](#custom-themes) for instructions on customizing themes. Removing `backgroundColor` should usually work.\n\n## Acknowledgements\n\n-   [diff-so-fancy](https://github.com/so-fancy/diff-so-fancy) for showing what's possible\n-   [shikijs](https://github.com/shikijs/shiki) for making it easy to do high quality syntax highlighting\n-   [chalk](https://github.com/chalk/chalk) for making it easy to do terminal styling reliably\n-   [delta](https://github.com/dandavison/delta) which approaches the same problem in Rust\n","funding_links":[],"categories":["HarmonyOS","TypeScript","Uncategorized","Packages","visual-studio-code","Source Code"],"sub_categories":["Windows Manager","Uncategorized","Diff Enhancers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanga%2Fgit-split-diffs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanga%2Fgit-split-diffs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanga%2Fgit-split-diffs/lists"}