https://github.com/suhlig/git-dirty
Rake task to record the git status in a separate file
https://github.com/suhlig/git-dirty
git rake
Last synced: 2 months ago
JSON representation
Rake task to record the git status in a separate file
- Host: GitHub
- URL: https://github.com/suhlig/git-dirty
- Owner: suhlig
- License: mit
- Created: 2019-03-27T09:44:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-23T07:38:09.000Z (almost 4 years ago)
- Last Synced: 2025-03-23T23:52:56.958Z (over 1 year ago)
- Topics: git, rake
- Language: Ruby
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE.txt
Awesome Lists containing this project
README
# Git::DirtyFile
Rake task to record the git status in a separate file
# Usage
Add it to your Gemfile:
```ruby
gem "git-dirty"
```
In your `Rakefile`:
```ruby
require 'git-dirty'
git_dirty_file 'tmp/git-status'
```
Now you will have a new rake target for `tmp/git-status`, which will be updated whenever the contents of that file differ from the actual status.
The status is represented by the output of `git rev-parse --short HEAD` (which provides the SHA of the current git HEAD). If the workspace is dirty (i.e. has new, changed or deleted files), an asterisk (`*`) is appended.
# License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).