git-artifact
+Store and manage artifacts using git repositories with horizontal commit history
+ +🚀 Fast & Efficient
+Only fetch what you need with git's optimized storage
+🔄 CI/CD Ready
+Trigger builds with standard git push/pull workflows
+💰 Cost Effective
+Use existing git infrastructure, no additional systems
+Horizontal Git History Concept
+Commits are stored "horizontally" using tags rather than stacked vertically
+Interactive Demo
+Try git-artifact commands and see their effects
+ +Initialize Repository
+git artifact init --url=<remote_url> --path my-artifacts
+
+ Creates a new git-artifact repository and initializes it for horizontal commit storage.
+-
+
--url: Remote repository URL
+ --path: Local directory path
+
Add and Push Artifact
+cd my-artifacts
+cp -rf <build-dir>/my.lib /include .
+git artifact add-n-push -t v1.0
+
+ Copy your artifacts and commit them with a tag. The workspace is reset to the default branch after push.
+-
+
-t: Tag name for the artifact version
+
Fetch Latest Artifact
+git artifact fetch-co-latest --regex 'v*.*'
+
+ Download and checkout the latest artifact matching the regex pattern.
+-
+
--regex: Pattern to match tag names
+
Find Available Artifacts
+git artifact find-latest -r 'v*.*'
+
+ List available artifacts matching the pattern without downloading them.
+-
+
-r: Regex pattern for tag matching
+
Use Cases
+Library Distribution
+Store compiled libraries with different versions, easily accessible by version tags.
+# Store library artifacts
+git artifact add-n-push -t v1.2.3/release
+git artifact add-n-push -t v1.2.3/debug
+
+# Consumers fetch specific versions
+git artifact fetch-co -t v1.2.3/release
+ CI/CD Pipeline Artifacts
+Store build artifacts, test reports, and deployment packages in your CI/CD pipeline.
+# Pipeline stores artifacts by build number
+git artifact add-n-push -t build-${BUILD_NUMBER}/artifacts
+git artifact add-n-push -t build-${BUILD_NUMBER}/test-reports
+
+# Later stages fetch required artifacts
+git artifact fetch-co -t build-${BUILD_NUMBER}/artifacts
+ Embedded Development
+Manage firmware images, toolchains, and development dependencies across teams.
+# Store firmware for different targets
+git artifact add-n-push -t firmware-v2.1.0/arm
+git artifact add-n-push -t firmware-v2.1.0/x86
+
+# Developers fetch target-specific firmware
+git artifact fetch-co-latest --regex 'firmware-v*.*\/arm'
+ Source Code Dependencies
+Add source code references to artifacts for debugging and traceability.
+# Include source code with artifacts
+git submodule add <source-repo> src
+git artifact add-n-push -t v1.0/with-source
+
+# Full traceability and debugging capability
+git artifact fetch-co -t v1.0/with-source
+ API Reference
+Repository Management
+init
+Initialize a new artifact repository
+git artifact init --url <remote_url> --path <local_path>
+
+ clone
+Clone an existing artifact repository
+git artifact clone --url <remote_url> --path <local_path>
+
+ Artifact Operations
+add-n-push
+Add files, commit, and push with tag
+git artifact add-n-push -t <tag_name>
+
+ fetch-co
+Fetch and checkout specific tag
+git artifact fetch-co -t <tag_name>
+
+ fetch-co-latest
+Fetch and checkout latest matching tag
+git artifact fetch-co-latest --regex <pattern>
+
+ find-latest
+Find latest tag matching pattern
+git artifact find-latest -r <pattern>
+
+ Utility Commands
+reset
+Reset workspace and branches
+git artifact reset
+ fetch-tags
+Fetch all tags pointing to specific SHA1
+git artifact fetch-tags -s <sha1>
+
+ Installation
+Download git-artifact
+Clone the repository or download the script directly:
+git clone https://github.com/Praqma/git-artifact.git
+cd git-artifact
+ Add to PATH
+Make git-artifact available in your PATH:
+# Option 1: Copy to system PATH
+sudo cp git-artifact /usr/local/bin/
+
+# Option 2: Add current directory to PATH
+export PATH=$PATH:$(pwd)
+ Verify Installation
+Test that git-artifact is properly installed:
+git artifact --help
+ Prerequisites
+Ensure you have the required permissions:
+-
+
- Git push rights to create tags +
- Git delete rights for tag cleanup (optional) +
- Bash version 4.3 or higher +
Quick Start
+Get started with your first artifact repository:
+# Initialize a new artifact repository
+git artifact init --url=https://github.com/yourorg/my-artifacts.git --path ./my-artifacts
+
+# Add some files and create your first artifact
+cd my-artifacts
+echo "Hello World" > hello.txt
+git artifact add-n-push -t v1.0.0
+
+# Clone and fetch from another location
+git artifact clone --url=https://github.com/yourorg/my-artifacts.git --path ./consumer
+cd consumer
+git artifact fetch-co-latest --regex 'v*.*'
+