https://github.com/rexios80/git_info
Reads information about the local git repository to show in app
https://github.com/rexios80/git_info
Last synced: 24 days ago
JSON representation
Reads information about the local git repository to show in app
- Host: GitHub
- URL: https://github.com/rexios80/git_info
- Owner: Rexios80
- License: bsd-3-clause
- Created: 2021-07-21T19:43:17.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-19T19:37:42.000Z (over 1 year ago)
- Last Synced: 2024-05-01T16:17:26.455Z (about 1 year ago)
- Language: Dart
- Homepage: https://pub.dev/packages/git_info
- Size: 101 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# git_info
Reads information about the local git repository to show in app. Supports parsing the current branch name and commit hash.
## Getting Started
### pubspec.yaml
```yaml
assets:
- .git/
- .git/refs/heads/
- .git/refs/heads/feature/
# Include any other branch paths used in your project
```Unfortunately Flutter does not allow wild card asset definitions so you must specify all branch paths that could be used by your project
### settings.gradle
```kotlin
import org.apache.tools.ant.DirectoryScannerDirectoryScanner.removeDefaultExclude('**/.git')
DirectoryScanner.removeDefaultExclude('**/.git/**')
```Gradle excludes files in the `.git` folder by default.
### analysis_options.yaml
```yaml
analyzer:
errors:
asset_directory_does_not_exist: ignore
```To avoid having to change your assets every time you make a new branch, you must include branch paths that might not exist in the local repository. This causes an analysis issue that can be ignored with the above analysis option.
### Additional setup
If your `.git` folder is not in the same directory as your `pubspec.yaml`, you must create a link to the `.git` folder in the same folder as the `pubspec.yaml`. Including assets from a parent directory does not work. Run the following command to create the link: `ln -s ..path/to/.git .git`.