git

package
v1.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 13 Imported by: 0

README

ace-dt git

Overview

ace-dt git is a command group for performing Git to OCI or OCI to Git operations. Such operations allow a user to create a copy of a Git repository, storing it in an OCI compliant registry of their choice. The copy in OCI format is referred to as a "Commit Manifest" as it contains Git commits, as well as tag/head references.

Across Air-Gapped Networks

ace-dt git works with ace-dt mirror to create or update copies of git repositories within air-gapped network.

Process:

  1. Create or update a Commit Manifest containing a copy of a Git repository with ace-dt git to-oci.
  2. Transfer the Commit Manifest to the air-gapped network with ace-dt mirror.
  3. Create or update a Git repository within the air-gapped network with ace-dt git from-oci.

Example Workflow

Create a New Commit Manifest
If the tag reference does not exist
$ ace-dt git to-oci https://github.com/libgit2/libgit2 reg.example.com/examples/libgit2:sync v1.6.1
 ↦ Manifest digest: sha256:e6075ad2a2752a546753a056afb4e61a32a391bac8658e75450471f6a4862f65
 ↦ Commit Manifest update complete.
If the tag reference already exists, you may start clean and overwrite it
$ ace-dt git to-oci https://github.com/libgit2/libgit2 reg.example.com/examples/libgit2:sync v1.6.1 --clean
 ↦ Manifest digest: sha256:e6075ad2a2752a546753a056afb4e61a32a391bac8658e75450471f6a4862f65
 ↦ Commit Manifest update complete.
Create a New Git Repository from the Commit Manifest
$ ace-dt git from-oci reg.example.com/examples/libgit2:sync ~/destinationRepository/example/
 ↦ Git repository update complete. The following references have been updated:

 ↦ 8a871d13b7f4e186b8ad943ae5a7fcf30be52e67 refs/tags/v1.6.1
All Repository References
$ git show-ref
8a871d13b7f4e186b8ad943ae5a7fcf30be52e67 refs/tags/v1.6.1

OR

$ ace-dt git list-refs reg.example.com/examples/libgit2:sync
 ↦ Digest of reg.example.com/examples/libgit2:sync2: sha256:e6075ad2a2752a546753a056afb4e61a32a391bac8658e75450471f6a4862f65
 ↦ References:
 ↦ 8a871d13b7f4e186b8ad943ae5a7fcf30be52e67 refs/tags/v1.6.1
Update an Existing Commit Manifest
$ ace-dt git to-oci https://github.com/libgit2/libgit2 reg.example.com/examples/libgit2:sync v1.6.2
 ↦ Manifest digest: sha256:957b0ea2506585fd86d4796557ac080b0ab8a79808c490458a22b44a185adf34
 ↦ Commit Manifest update complete.
Update a Git Repository from the Updated Commit Manifest
$ ace-dt git from-oci reg.example.com/examples/libgit2:sync ~/destinationRepository/example/ 
 ↦ Git repository update complete. The following references have been updated:

 ↦ 25ec37379ed07b10c4ecc6143cf6018cabc8f857 refs/tags/v1.6.2
All Repository References Again
$ git show-ref
8a871d13b7f4e186b8ad943ae5a7fcf30be52e67 refs/tags/v1.6.1
25ec37379ed07b10c4ecc6143cf6018cabc8f857 refs/tags/v1.6.2

OR

$ ace-dt git list-refs reg.example.com/examples/libgit2:sync
 ↦ Digest of reg.example.com/examples/libgit2:sync2: sha256:e6075ad2a2752a546753a056afb4e61a32a391bac8658e75450471f6a4862f65
 ↦ References:
 ↦ 8a871d13b7f4e186b8ad943ae5a7fcf30be52e67 refs/tags/v1.6.1
 ↦ 25ec37379ed07b10c4ecc6143cf6018cabc8f857 refs/tags/v1.6.2

Documentation

Overview

Package git facilitates executing actions for git repositories stored in an OCI registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	*actions.DataTool

	AltGitExec    string
	AltGitLFSExec string
	LFS           bool
	LFSServerURL  string

	CacheDir string
}

Action represents a general git-oci action.

type FromOCI

type FromOCI struct {
	*Action

	Repo      string
	GitRemote string
	Force     bool
}

FromOCI represents the git rebuild action.

func (*FromOCI) Run

func (action *FromOCI) Run(ctx context.Context) error

Run performs the FromOCI operation.

type ListRefs

type ListRefs struct {
	*Action

	Repo string
}

ListRefs represents the git list-refs action.

func (*ListRefs) Run

func (action *ListRefs) Run(ctx context.Context) error

Run performs the list-refs operation.

type ToOCI

type ToOCI struct {
	*Action

	Clean bool

	GitRemote string
	Repo      string
	RevList   []string // rev-list: Reverse Chronological Order, a git convention
}

ToOCI represents the git sync action.

func (*ToOCI) Run

func (action *ToOCI) Run(ctx context.Context) error

Run performs the ToOCI operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL