Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scottgonzalez/pretty-diff
colorized HTML diffs
https://github.com/scottgonzalez/pretty-diff
Last synced: 19 days ago
JSON representation
colorized HTML diffs
- Host: GitHub
- URL: https://github.com/scottgonzalez/pretty-diff
- Owner: scottgonzalez
- License: mit
- Created: 2011-10-11T19:44:45.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2023-11-16T14:30:29.000Z (about 1 year ago)
- Last Synced: 2024-11-16T02:08:58.546Z (26 days ago)
- Language: JavaScript
- Homepage:
- Size: 38.1 KB
- Stars: 218
- Watchers: 4
- Forks: 27
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome - pretty-diff - colorized HTML diffs (JavaScript)
README
# Pretty Diff
Pretty diff generates colorized HTML diffs similar to the diff/commit views on GitHub.
Simply use `pretty-diff` the same way you use `git diff` and you'll get pretty diffs.
If you want to share the diff, you can use `gist-diff` and you'll get a new gist.![image](https://cloud.githubusercontent.com/assets/39191/10147714/8c358910-65e4-11e5-8e59-e1526ef674cd.png)
## Installation
Simply install globally via npm:
```sh
npm install -g pretty-diff
```## Usage
### pretty-diff
`pretty-diff` has no settings of its own.
Simply provide whatever settings you want to pass to `git diff`.For example, to see what changed in the last commit:
```sh
pretty-diff HEAD^
```### gist-diff
`gist-diff` has one setting: `--public`.
By default `gist-diff` will generate a private gist.
If `--public` is provided, the gist will be public.
This setting can be specified anywhere (before or after the `git diff` settings).`gist-diff` will attempt to create the gist using your GitHub account.
In order to create the gist with your account, you will be prompted for your password.
If you enter no password, then an anonymous gist will be generated.
However, if you enter an incorrect password, then no gist will be generated.#### Authentication
If you set your GitHub username in your git config, you will only be prompted for your password.
```sh
git config --global github.user "Your Username"
```To avoid being prompted for your password, you can
[create a personal access token](https://github.com/settings/applications) and
store it in your git config. You don't need to set `github.user` if you're using
a token.```sh
git config --global gist-diff.token "Your token"
```## License
Copyright Scott González. Released under the terms of the MIT license.