{"id":13395366,"url":"https://github.com/so-fancy/diff-so-fancy","last_synced_at":"2025-05-12T20:42:47.925Z","repository":{"id":37359462,"uuid":"51071818","full_name":"so-fancy/diff-so-fancy","owner":"so-fancy","description":"Good-lookin' diffs. Actually… nah… The best-lookin' diffs. :tada:","archived":false,"fork":false,"pushed_at":"2025-02-05T05:56:20.000Z","size":652,"stargazers_count":17596,"open_issues_count":32,"forks_count":336,"subscribers_count":115,"default_branch":"next","last_synced_at":"2025-05-05T16:04:15.018Z","etag":null,"topics":["diff","diff-highlight","diffs","fancy","git","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Perl","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/so-fancy.png","metadata":{"files":{"readme":"README.md","changelog":"history.md","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,"publiccode":null,"codemeta":null}},"created_at":"2016-02-04T11:32:08.000Z","updated_at":"2025-05-04T15:47:53.000Z","dependencies_parsed_at":"2023-02-11T03:30:57.034Z","dependency_job_id":"ac12af9f-6048-469c-b3e0-28a4f02c3140","html_url":"https://github.com/so-fancy/diff-so-fancy","commit_stats":{"total_commits":549,"total_committers":95,"mean_commits":5.778947368421052,"dds":0.6757741347905282,"last_synced_commit":"39cd6a1e68acdce4247c56ff8fd1345d0e970b68"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so-fancy%2Fdiff-so-fancy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so-fancy%2Fdiff-so-fancy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so-fancy%2Fdiff-so-fancy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/so-fancy%2Fdiff-so-fancy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/so-fancy","download_url":"https://codeload.github.com/so-fancy/diff-so-fancy/tar.gz/refs/heads/next","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253818054,"owners_count":21969100,"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":["diff","diff-highlight","diffs","fancy","git","hacktoberfest"],"created_at":"2024-07-30T17:01:54.212Z","updated_at":"2025-05-12T20:42:47.919Z","avatar_url":"https://github.com/so-fancy.png","language":"Perl","funding_links":[],"categories":["Perl","Development","开源工具","Uncategorized","GitShit","Alternatives to `diff`","语言资源库","终端","hacktoberfest","git","\u003ca name=\"diff\"\u003e\u003c/a\u003eDiff","Source Code","Tool","Lovely Commands","Git Interfaces"],"sub_categories":["Time Series","命令行工具","Uncategorized","tools","网络服务_其他","Diff Enhancers","TUI Tool"],"readme":"# diff-so-fancy  [![Circle CI build](https://circleci.com/gh/so-fancy/diff-so-fancy.svg?style=shield)](https://circleci.com/gh/so-fancy/diff-so-fancy) [![TravisCI build](https://travis-ci.org/so-fancy/diff-so-fancy.svg?branch=master)](https://travis-ci.org/so-fancy/diff-so-fancy) [![AppVeyor build](https://ci.appveyor.com/api/projects/status/github/so-fancy/diff-so-fancy?branch=master\u0026svg=true)](https://ci.appveyor.com/project/stevemao/diff-so-fancy/branch/master)\n\n`diff-so-fancy` strives to make your diffs **human** readable instead of machine readable. This helps improve code quality and helps you spot defects faster.\n\n## Screenshot\n\nVanilla `git diff` vs `git` and `diff-so-fancy`\n\n![diff-highlight vs diff-so-fancy](diff-so-fancy.png)\n\n## Install\n\nSimply copy the `diff-so-fancy` script from the latest release into your `$PATH` and you're done. Alternately to test development features you can clone this repo and then put the `diff-so-fancy` script (symlink will work) into your `$PATH`. The `lib/` directory will need to be kept relative to the core script.\n\nIf you are using a ZSH framework like [zgenom](https://github.com/jandamm/zgenom) or [oh-my-zsh](https://ohmyz.sh), refer to [Zsh plugin support for diff-so-fancy](pro-tips.md) for detailed installation instructions.\n\n`diff-so-fancy` is also available from the [NPM registry](https://www.npmjs.com/package/diff-so-fancy), [brew](https://formulae.brew.sh/formula/diff-so-fancy), as a package on [Nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/version-management/diff-so-fancy/default.nix), [Fedora](https://packages.fedoraproject.org/pkgs/diff-so-fancy/diff-so-fancy/), in the [Arch extra repo](https://archlinux.org/packages/extra/any/diff-so-fancy/), and as [ppa:aos for Debian/Ubuntu Linux](https://github.com/aos/dsf-debian).\n\nIssues relating to packaging (\"installation does not work\", \"version is out of date\", etc.) should be directed to those packages' repositories/issue trackers where applicable.\n\n**Note:** Windows users may need to install [MinGW](https://sourceforge.net/projects/mingw/files/) or the [Windows subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10).\n\n## Usage\n\n### With git\n\nConfigure git to use `diff-so-fancy` for all diff output:\n\n```shell\ngit config --global core.pager \"diff-so-fancy | less --tabs=4 -RF\"\ngit config --global interactive.diffFilter \"diff-so-fancy --patch\"\n```\n\n### Improved colors for the highlighted bits\n\nThe default Git colors are not optimal. The colors used for the screenshot above were:\n\n```shell\ngit config --global color.ui true\n\ngit config --global color.diff-highlight.oldNormal    \"red bold\"\ngit config --global color.diff-highlight.oldHighlight \"red bold 52\"\ngit config --global color.diff-highlight.newNormal    \"green bold\"\ngit config --global color.diff-highlight.newHighlight \"green bold 22\"\n\ngit config --global color.diff.meta       \"11\"\ngit config --global color.diff.frag       \"magenta bold\"\ngit config --global color.diff.func       \"146 bold\"\ngit config --global color.diff.commit     \"yellow bold\"\ngit config --global color.diff.old        \"red bold\"\ngit config --global color.diff.new        \"green bold\"\ngit config --global color.diff.whitespace \"red reverse\"\n```\n\n### With diff\n\nUse `-u` with `diff` for unified output, and pipe the output to `diff-so-fancy`:\n\n```shell\ndiff -u file_a file_b | diff-so-fancy\n```\n\nIt also supports the recursive mode of diff with `-r` or `--recursive` as **first argument**\n\n```shell\ndiff -r -u folder_a folder_b | diff-so-fancy\n```\n\n```shell\ndiff --recursive -u folder_a folder_b | diff-so-fancy\n```\n## Options\n\n### markEmptyLines\n\nShould the first block of an empty line be colored. (Default: true)\n\n```shell\ngit config --bool --global diff-so-fancy.markEmptyLines false\n```\n\n### changeHunkIndicators\n\nSimplify git header chunks to a more human readable format. (Default: true)\n\n```shell\ngit config --bool --global diff-so-fancy.changeHunkIndicators false\n```\n\n### stripLeadingSymbols\n\nShould the pesky `+` or `-` at line-start be removed. (Default: true)\n\n```shell\ngit config --bool --global diff-so-fancy.stripLeadingSymbols false\n```\n\n### useUnicodeRuler\n\nBy default, the separator for the file header uses Unicode line-drawing characters. If this is causing output errors on your terminal, set this to `false` to use ASCII characters instead. (Default: true)\n\n```shell\ngit config --bool --global diff-so-fancy.useUnicodeRuler false\n```\n\n### rulerWidth\n\nBy default, the separator for the file header spans the full width of the terminal. Use this setting to set the width of the file header manually.\n\n```shell\ngit config --global diff-so-fancy.rulerWidth 80\n```\n\n## The diff-so-fancy team\n\n| Person                | Role             |\n| --------------------- | ---------------- |\n| @scottchiefbaker      | Project lead     |\n| @OJFord               | Bug triage       |\n| @GenieTim             | Travis OSX fixes |\n| @AOS                  | Debian packager  |\n| @Stevemao/@Paul Irish | NPM release team |\n\n## Contributing\n\nPull requests are quite welcome, and should target the [`next` branch](https://github.com/so-fancy/diff-so-fancy/tree/next). We are also looking for any feedback or ideas on how to make `diff-so-fancy` even *fancier*.\n\n### Other documentation\n\n* [Pro-tips on advanced usage](pro-tips.md)\n* [Reporting Bugs](reporting-bugs.md)\n* [Hacking and Testing](hacking-and-testing.md)\n* [History](history.md)\n\n## Alternatives\n\n* [Delta](https://github.com/dandavison/delta)\n* [Lazygit](https://github.com/jesseduffield/lazygit) with diff-so-fancy [integration](https://github.com/jesseduffield/lazygit/blob/master/docs/Custom_Pagers.md#diff-so-fancy)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fso-fancy%2Fdiff-so-fancy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fso-fancy%2Fdiff-so-fancy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fso-fancy%2Fdiff-so-fancy/lists"}