Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/place-labs/git-repository
remote git repository inspection
https://github.com/place-labs/git-repository
Last synced: 3 months ago
JSON representation
remote git repository inspection
- Host: GitHub
- URL: https://github.com/place-labs/git-repository
- Owner: place-labs
- License: mit
- Created: 2022-05-04T23:04:51.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-28T04:12:40.000Z (over 1 year ago)
- Last Synced: 2024-01-27T09:09:44.126Z (10 months ago)
- Language: Crystal
- Size: 32.2 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - git-repository - A git cli wrapper querying and cloning remote repositories with minimal data transfer (CLI Utils)
README
# Git Client for inspecting remote git repositories
[![CI](https://github.com/place-labs/git-repository/actions/workflows/ci.yml/badge.svg)](https://github.com/place-labs/git-repository/actions/workflows/ci.yml)
The aim of this shard is to inspect any remote git repository
* fetch repository details remotely (default branch, branches and tags)
* obtain log history without downloading any files
* fetch any branch, tag or commit without downloading history. Minimal data transfer## Installation
Add the dependency to your `shard.yml`:
```yaml
dependencies:
git-repository:
github: place-labs/git-repository
```## Usage
NOTE:: We shell out to `git` to perform these operations
```crystal
repo = GitRepository.new("https://github.com/your/repo", "optional_user", "optional_pass")
repo.default_branch # => "main"
repo.branches # => {"feature1" => "", "main" => ""}
repo.tags # => {"v1.1.0" => "", "v1.0.0" => ""}
repo.commits("main", depth: 5) # => [Commit]# Fetch the head of the selected branch
repo.fetch_branch("main", "./your_repo_folder")# Fetch the repo at a specific commit or tag
repo.fetch_commit("v1.1.0", "./your_repo_folder")```