git (egit v0.2.0)

View Source

Erlang NIF bindings for libgit2.

This module provides comprehensive git repository operations without requiring the external git executable. Operations range from basic repo management (init, clone, open) to advanced functionality (blame, cherry-pick, reflog).

Common Use Cases

Repository Operations

Repo = git:open("/path/to/repo"),
git:status(Repo),
git:fetch(Repo),
git:pull(Repo),
git:push(Repo)

Commit Operations

git:add(Repo, "src/*.erl"),
git:commit(Repo, "Update implementation"),
git:rev_parse(Repo, "HEAD~5")

Branch Management

git:branch_create(Repo, "feature/my-feature"),
git:checkout(Repo, "feature/my-feature"),
git:list_branches(Repo, [local])

Code Analysis

git:blame(Repo, "src/main.erl"),
git:describe(Repo, "HEAD"),
git:reflog(Repo, "main")

Summary

Functions

Add files matching PathSpecs to index. See add/3.

Add files matching PathSpecs to index with options.

Add all pending changes (equivalent to git add .). See add/2 and add/3.

Show file change history by line. Returns a list of {LineNumber, {Author, Email}, CommitOID, Time} tuples.

Show file change history by line with options. Opts is a list of

Create a branch Example

Delete a branch

Same as cat_file(Repo, Rev, []). See cat_file/3.

Provide content or type and size information for repository objects. Example

Same as checkout(Repo, Revision, []).

Check out a revision or branch.

Apply a single commit to current branch. Returns ok on success, {conflict, Conflicts} on merge conflict, or {error, Reason} on failure.

Clone a remote repository to the local path

Commit staged changes to the repository. Returns {ok, OID} where OID is the new commit hash, or {ok, nil} if there are no staged changes.

Lookup commit details identified by OID.

Get git configuration value Example

Set git configuration value Example

Describe working tree state. Returns a human-readable description of the most recent tag and commits. Example: "v1.0.0-5-gabcd123"

Describe working tree state with options. Opts is a list of

Compare two revisions and return list of differences. See: diff/4.

Compare two revisions and return list of differences. Returns list of {Path, Status, StatusCode, Similarity} tuples. Status values: "added", "deleted", "modified", "renamed", "copied", "typechange"

Fetch from origin

Fetch from given remote (e.g. origin).

Init a repository. See: init/2.

Init a repository. If Opts' list containsbare', a Git repository without a working directory is created at the pointed path. Otherwise, the provided path will be considered as the working directory into which the .git directory will be created.

List branches. See list_branches/2.

List index. See list_index/2.

List remotes. Returns a list of {Name, URL, [push|fetch]} triples.

List all tags in the repository. Lightweight tags are returned as plain binaries; annotated tags are also returned as plain binaries unless the {lines, N} option is used. See list_tags/2.

List tags, optionally filtered by pattern or with options. When PatternOrOpts is a string or binary it is used as a glob pattern to filter tag names (e.g. "v1.*"). When it is a proplist, the following options are recognised

Merge another branch into the current branch. Returns {ok, Status}' where Status is 'up_to_date', 'fast_forward', or 'merged'. On conflict returns{conflict, ConflictList}'.

Move/rename a file in the index and write the index.

Open a local git repository

Pull from origin

Pull from given remote (e.g. origin).

Push changes to remote (origin)

Push to given remote

Push refs to given remote

Abort the current rebase operation.

Finish the rebase operation.

Initialize a rebase operation. Returns number of operations in the rebase sequence.

Continue to the next rebase operation. Returns 'done' when all operations are complete, or operation info.

Show reference logs. Returns a list of {OID, Message, Author, Time} tuples.

Delete a remote

Change the fetch/push URL for a remote. See remote_set_url/4.

Change the fetch/push URL for a remote. If Opts contains push, the URL is set only as the push URL.

Remove a file from the index and write the index.

Return the list of OIDs for the given specs.

Same as rev_parse(Repo, Spec, []).

Reverse parse a reference. See [https://git-scm.com/docs/git-rev-parse.html#_specifying_revisions] for the formats of a Spec.

Revert a commit (creates new commit undoing the changes). Returns ok' on success,{conflict, Conflicts}' on merge conflict.

Apply a stash without removing it. Returns ok' on success,{conflict, Conflicts}' on conflict.

Delete a stash.

List all stashed changes. Returns list of {Index, Name} tuples.

Apply and remove a stash. Returns ok' on success,{conflict, Conflicts}' on conflict.

Save uncommitted changes to stash. Returns {ok, StashOID}' or{error, no_changes}' if nothing to stash.

Get repository status

Get repository status

Create a tag

Create a tag

Delete a tag

Types

add_opt()

-type add_opt() :: verbose | dry_run | update | force.

add_opts()

-type add_opts() :: [add_opt()].

add_result()

-type add_result() :: nil | #{mode => dry_run | added, files => [binary()]} | {error, term()}.

branch_create_opts()

-type branch_create_opts() :: [overwrite | {target, binary()}].

Branch creation options

  • overwrite — Force to overwrite the existing branch
  • {target, Commit} — Use the target commit (default ~"HEAD")

cat_file_opt()

-type cat_file_opt() :: type | size | {abbrev, pos_integer()}.

cat_file_opts()

-type cat_file_opts() :: [cat_file_opt()].

cfg_source()

-type cfg_source() :: repository() | default | system | xdg | global | local | app | highest.

Configuration source. If the value is an atom, then:

  • default — Find default configuration file for this app
  • system — System-wide configuration file - /etc/gitconfig on Linux systems
  • xdg — XDG compatible configuration file, typically ~/.config/git/config
  • global — User-specific global configuration file, typically ~/.gitconfig
  • local — Repository specific configuration file; $WORK_DIR/.git/config on non-bare repos
  • app — Application specific configuration file; freely defined by applications
  • highest — The most specific config file available for the app

checkout_opt()

-type checkout_opt() :: force | verbose | perf.

checkout_opts()

-type checkout_opts() :: [checkout_opt()].

checkout_stats()

-type checkout_stats() ::
          #{chmod_calls => integer(),
            mkdir_calls => integer(),
            stat_calls => integer(),
            total_steps => integer()}.

commit_opt()

-type commit_opt() ::
          encoding | message | summary | time | time_offset | committer | author | header | tree_id.

commit_opts()

-type commit_opts() :: [commit_opt()].

list_branch_opt()

-type list_branch_opt() :: local | remote | all | fullname | {limit, pos_integer()}.

List branch option.

  • local — Return only local branches
  • remote — Return only remote branches
  • all — Return all branches (default)
  • fullname — Return full branch names
  • {limit, Limit} — Return up to this number of branches

list_branch_opts()

-type list_branch_opts() :: [list_branch_opt()].

list_index_entry()

-type list_index_entry() ::
          #{path => binary(),
            stage => [normal | ancestor | ours | theirs],
            conflict => boolean(),
            oid => binary(),
            mode => pos_integer(),
            size => non_neg_integer(),
            ctime => pos_integer(),
            mtime => pos_integer()}.

list_index_opt()

-type list_index_opt() ::
          {abbrev, pos_integer()} |
          {fields, all | [path | stage | conflict | oid | mode | size | ctime | mtime]}.

List index option.

  • {abbrev, NumChars} — NumChars truncates the commit hash (must be less then 40).
  • {fields, ListOfFields} — Field list to return. If not specified, the option will default to [path].

list_index_opts()

-type list_index_opts() :: [list_index_opt()].

repository()

-type repository() :: reference().

rev_list_opt()

-type rev_list_opt() ::
          [topo_order | date_order | reverse | {limit, pos_integer()} | {abbrev, pos_integer()}].

rev_list_opts()

-type rev_list_opts() :: [rev_list_opt()].

rev_parse_opt()

-type rev_parse_opt() :: {abbrev, pos_integer()}.

rev_parse_opts()

-type rev_parse_opts() :: [rev_parse_opt()].

status_opt()

-type status_opt() ::
          {untracked, none | normal | recursive} |
          {paths, [binary()]} |
          branch | ignored | submodules | ignore_submodules.

Status function options

  • {untracked, Untracked}Untracked can be one of:
    • none - don't include untracked files
    • normal - include untracked files
    • recursive - include untracked files and recurse into untracked directories
  • {paths, Paths}Path is an array of path patterns to match
  • branch — Include branch name
  • ignored — Include ignored files
  • ignore_submodules — Indicates that submodules should be skipped
  • submodules — Include submodules (overrides ignore_submodules)

status_opts()

-type status_opts() :: [status_opt()].

tag_opt()

-type tag_opt() :: [{message, binary()} | {pattern, binary()} | {target, binary()} | {lines, integer()}].

Tag creation options

  • {message, Msg} — Message associated with the tag's commit
  • {pattern, Pat} — Pattern to search matching tags
  • {target, SHA} — Target commit SHA to be associated with the tag
  • {lines, Num} — Number of lines in the commit to store

tag_opts()

-type tag_opts() :: [tag_opt()].

Functions

add/2

-spec add(repository(), binary() | string() | [binary() | string()]) -> add_result().

Add files matching PathSpecs to index. See add/3.

add/3

-spec add(repository(), [binary() | string()], add_opts()) -> add_result().

Add files matching PathSpecs to index with options.

add_all(Repo)

-spec add_all(repository()) -> add_result().

Add all pending changes (equivalent to git add .). See add/2 and add/3.

blame(Repo, Path)

-spec blame(repository(), string() | binary()) ->
               [{non_neg_integer(), {binary(), binary()}, binary(), integer()}].

Show file change history by line. Returns a list of {LineNumber, {Author, Email}, CommitOID, Time} tuples.

blame(Repo, Path, Opts)

-spec blame(repository(), string() | binary(), list()) ->
               [{non_neg_integer(), {binary(), binary()}, binary(), integer()}].

Show file change history by line with options. Opts is a list of:

  • {pattern, Pattern} - Pattern to match tags

branch_create(Repo, Name)

Create a branch See: git:branch_create/3.

branch_create(Repo, Name, Opts)

-spec branch_create(repository(), binary() | string(), branch_create_opts()) -> ok | {error, binary()}.

Create a branch Example:

1> R = git:clone(~"https://github.com/saleyn/egit.git", "/tmp/egit").
#Ref<0.170091758.2335834136.12133>
2> git:branch_create(R, "tmp").
ok

branch_delete(Repo, Name)

-spec branch_delete(repository(), binary() | string()) -> ok | {error, binary()}.

Delete a branch

branch_rename(Repo, OldName, NewName)

Rename a branch See: branch_rename/4.

branch_rename(Repo, OldName, NewName, Opts)

-spec branch_rename(repository(), binary() | string(), binary() | string(), [overwrite]) ->
                       ok | {error, binary()}.

Rename a branch

cat_file(Repo, Rev)

-spec cat_file(repository(), binary() | string()) -> map() | {error, term()}.

Same as cat_file(Repo, Rev, []). See cat_file/3.

cat_file(Repo, Rev, Opts)

-spec cat_file(repository(), binary() | string(), cat_file_opts()) -> {ok, term()} | {error, term()}.

Provide content or type and size information for repository objects. Example:

1> R = git:open(".").
2> git:cat_file(R, "main", [{abbrev, 5}]).
#{type => commit,
  author => {~"John Doh",~"test@gmail.com",1686195121, -14400},
  oid => ~"b85d0",
  parents => [~"1fd4b"]}
7> git:cat_file(R, "b85d0", [{abbrev, 5}]).
#{type => tree,
  commits =>
      [{~".github",~"tree",~"1e41f",16384},
       {~".gitignore",~"blob",~"b893a",33188},
       {~".gitmodules",~"blob",~"2550a",33188},
       {~".vscode",~"tree",~"c7b1b",16384},
       {~"LICENSE",~"blob",~"d6456",33188},
       {~"Makefile",~"blob",~"2d635",33188},
       {~"README.md",~"blob",~"7b3d0",33188},
       {~"c_src",~"tree",~"147f3",16384},
       {~"rebar.config",~"blob",~"1f68a",33188},
       {~"rebar.lock",~"blob",~"57afc",33188},
       {~"src",~"tree",~"1bccb",16384}]}
8> git:cat_file(R, "b893a", [{abbrev, 5}]).
#{type => blob,
  data => ~"*.swp\n*.dump\n/c_src/*.o\n/c_src/fmt\n/priv/*.so\n/_build\n/doc\n"}

checkout(Repo, Rev)

-spec checkout(repository(), binary() | string()) -> ok | {error, term()}.

Same as checkout(Repo, Revision, []).

checkout(Repo, Revision, Opts)

-spec checkout(repository(), binary(), checkout_opts()) -> ok | checkout_stats() | {error, term()}.

Check out a revision or branch.

Opts is a list of:

  • force - Force the checkout even if there are conflicts
  • verbose - Return a checkout_stats() map instead of ok
  • perf - Include performance counters in the stats map (requires verbose)

cherry_pick(Repo, CommitOID)

-spec cherry_pick(repository(), string() | binary()) -> ok | {conflict, [binary()]} | {error, term()}.

Apply a single commit to current branch. Returns ok on success, {conflict, Conflicts} on merge conflict, or {error, Reason} on failure.

clone(URL, Path)

-spec clone(binary() | string(), binary() | string()) -> repository().

Clone a remote repository to the local path

commit(Repo, Comment)

-spec commit(repository(), binary() | string()) ->
                {ok, OID :: binary() | nil} | {error, binary() | atom()}.

Commit staged changes to the repository. Returns {ok, OID} where OID is the new commit hash, or {ok, nil} if there are no staged changes.

commit_lookup(Repo, OID, Opts)

-spec commit_lookup(repository(), binary() | string(), [commit_opt()]) -> #{commit_opt() => term()}.

Lookup commit details identified by OID.

Opts is a list of commit_opt() field names to return. An empty list returns an empty map. Pass any of: encoding, message, summary, time, time_offset, committer, author, header, tree_id.

Example:

1> R = git:open("/tmp/egit").
2> {ok, OID} = git:rev_parse(R, "HEAD").
3> git:commit_lookup(R, OID, [author, message, time]).
#{author => {~"John Doh",~"test@gmail.com",1686195121,-14400},
  message => ~"Add test files\n",
  time => 1686195121}

config_get(Src, Key)

-spec config_get(cfg_source(), binary() | string()) -> {ok, binary()} | {error, binary() | atom()}.

Get git configuration value Example:

1> R = git:clone(~"https://github.com/saleyn/egit.git", "/tmp/egit").
#Ref<0.170091758.2335834136.12133>
2> git:config_get(R, "user.name").
{ok,~"John Doh"}

config_set(Src, Key, Val)

-spec config_set(cfg_source(), binary() | string(), binary() | string()) ->
                    ok | {error, binary() | atom()}.

Set git configuration value Example:

1> R = git:clone(~"https://github.com/saleyn/egit.git", "/tmp/egit").
#Ref<0.170091758.2335834136.12133>
2> git:config_set(R, "user.name", "Test User").
ok

describe(Repo, Rev)

-spec describe(repository(), string() | binary()) -> {ok, binary()} | {error, term()}.

Describe working tree state. Returns a human-readable description of the most recent tag and commits. Example: "v1.0.0-5-gabcd123"

describe(Repo, Rev, Opts)

-spec describe(repository(), string() | binary(), list()) -> {ok, binary()} | {error, term()}.

Describe working tree state with options. Opts is a list of:

  • {pattern, Pattern} - Pattern to match tags

diff(Repo, FromRev, ToRev)

-spec diff(repository(), string() | binary(), string() | binary()) ->
              [{binary(), binary(), integer(), integer()}].

Compare two revisions and return list of differences. See: diff/4.

diff(Repo, FromRev, ToRev, Opts)

-spec diff(repository(), string() | binary(), string() | binary(), list()) ->
              [{binary(), binary(), integer(), integer()}].

Compare two revisions and return list of differences. Returns list of {Path, Status, StatusCode, Similarity} tuples. Status values: "added", "deleted", "modified", "renamed", "copied", "typechange"

fetch(Repo)

-spec fetch(repository()) -> ok | {error, binary()}.

Fetch from origin

fetch(Repo, Remote)

-spec fetch(repository(), binary() | string()) -> ok | {error, binary()}.

Fetch from given remote (e.g. origin).

init(Path)

-spec init(binary() | string()) -> repository().

Init a repository. See: init/2.

init(Path, Opts)

-spec init(binary() | string(), [bare]) -> repository().

Init a repository. If Opts' list containsbare', a Git repository without a working directory is created at the pointed path. Otherwise, the provided path will be considered as the working directory into which the .git directory will be created.

list_branches(Repo)

List branches. See list_branches/2.

list_branches(Repo, Opts)

-spec list_branches(repository(), list_branch_opts()) -> [{local | remote, binary()}].

List branches

list_index(Repo)

List index. See list_index/2.

list_index(Repo, Opts)

-spec list_index(repository(), list_index_opts()) -> [list_index_entry()].

List index.

list_remotes(Repo)

-spec list_remotes(repository()) -> [{binary(), binary(), [push | fetch]}].

List remotes. Returns a list of {Name, URL, [push|fetch]} triples.

list_tags(Repo)

-spec list_tags(repository()) -> [binary() | {binary(), binary()}] | {error, binary() | atom()}.

List all tags in the repository. Lightweight tags are returned as plain binaries; annotated tags are also returned as plain binaries unless the {lines, N} option is used. See list_tags/2.

list_tags/2

-spec list_tags(repository(), string() | binary() | list()) ->
                   [binary() | {binary(), binary()}] | {error, binary() | atom()}.

List tags, optionally filtered by pattern or with options. When PatternOrOpts is a string or binary it is used as a glob pattern to filter tag names (e.g. "v1.*"). When it is a proplist, the following options are recognised:

  • {pattern, Pat} - Glob pattern to filter tag names (default "*")
  • {lines, N} - Include up to N lines of the tag/commit message. Annotated tags whose message is non-empty are returned as {Name, Message} tuples; all others remain plain binaries.

Example:

1> R = git:open("/tmp/egit").
2> git:list_tags(R, "v0.*").
[~"v0.1.0",~"v0.2.0"]
3> git:list_tags(R, [{lines, 1}]).
[{~"v0.1.0",~"Release 0.1.0\n"},~"v0.2.0"]

merge(Repo, Branch)

-spec merge(repository(), string() | binary()) ->
               {ok, atom()} | {conflict, [binary()]} | {error, term()}.

Merge another branch into the current branch. Returns {ok, Status}' where Status is 'up_to_date', 'fast_forward', or 'merged'. On conflict returns{conflict, ConflictList}'.

move(Repo, OldPath, NewPath)

-spec move(repository(), string() | binary(), string() | binary()) -> ok | {error, term()}.

Move/rename a file in the index and write the index.

open(Path)

-spec open(binary() | string()) -> repository().

Open a local git repository

pull(Repo)

-spec pull(repository()) -> ok | {error, binary()}.

Pull from origin

pull(Repo, Remote)

-spec pull(repository(), binary() | string()) -> ok | {error, binary()}.

Pull from given remote (e.g. origin).

push(Repo)

-spec push(repository()) -> ok | {error, binary()}.

Push changes to remote (origin)

push(Repo, Remote)

-spec push(repository(), binary() | string()) -> ok | {error, binary()}.

Push to given remote

push(Repo, Remote, Refs)

-spec push(repository(), binary() | string(), [binary() | string()]) -> ok | {error, binary()}.

Push refs to given remote

rebase_abort(Repo)

-spec rebase_abort(repository()) -> ok | {error, term()}.

Abort the current rebase operation.

rebase_finish(Repo)

-spec rebase_finish(repository()) -> ok | {error, term()}.

Finish the rebase operation.

rebase_init(Repo, OntoRef)

-spec rebase_init(repository(), string() | binary()) -> integer() | {error, term()}.

Initialize a rebase operation. Returns number of operations in the rebase sequence.

rebase_next(Repo)

-spec rebase_next(repository()) -> done | tuple() | {error, term()}.

Continue to the next rebase operation. Returns 'done' when all operations are complete, or operation info.

reflog(Repo, RefName)

-spec reflog(repository(), string() | binary()) -> [{binary(), binary(), binary(), integer()}].

Show reference logs. Returns a list of {OID, Message, Author, Time} tuples.

remote_add(Repo, Name, URL)

-spec remote_add(repository(), binary() | string(), binary() | string()) -> ok | {error, binary()}.

Add a remote

remote_delete(Repo, Name)

-spec remote_delete(repository(), binary() | string()) -> ok | {error, binary()}.

Delete a remote

remote_rename(Repo, OldName, NewName)

-spec remote_rename(repository(), binary() | string(), binary() | string()) -> ok | {error, binary()}.

Rename a remote

remote_set_url(Repo, Name, URL)

-spec remote_set_url(repository(), binary() | string(), binary() | string()) -> ok | {error, binary()}.

Change the fetch/push URL for a remote. See remote_set_url/4.

remote_set_url(Repo, Name, URL, Opts)

Change the fetch/push URL for a remote. If Opts contains push, the URL is set only as the push URL.

remove(Repo, Path)

-spec remove(repository(), string() | binary()) -> ok | {error, term()}.

Remove a file from the index and write the index.

reset(Repo, Type)

-spec reset(repository(), soft | mixed | hard) -> ok | {error, term()}.

rev_list(Repo, Specs, Opts)

-spec rev_list(repository(), ['not' | 'Elixir.Not' | string() | binary()] | binary(), rev_list_opts()) ->
                  #{commit_opt() => term()}.

Return the list of OIDs for the given specs.

Opts is a list of:

topo_order | date_order | reverse
Control sorting order
{limit, `Limit'}
Limit is an integer that limits the number of refs returned
{abbrev, `NumChars'}
NumChars truncates the commit hash (must be less then 40)

Example:

9> git:rev_list(R, ["HEAD"], [{limit, 4}, {abbrev, 7}]).
[~"f791f01",~"1b74c46",~"c40374d",~"12968bd"]

rev_parse(Repo, Spec)

-spec rev_parse(repository(), binary() | string()) ->
                   {ok, binary()} | map() | {error, binary() | atom()}.

Same as rev_parse(Repo, Spec, []).

rev_parse(Repo, Spec, Opts)

-spec rev_parse(repository(), binary() | string(), rev_parse_opts()) ->
                   {ok, binary()} | map() | {error, binary() | atom()}.

Reverse parse a reference. See [https://git-scm.com/docs/git-rev-parse.html#_specifying_revisions] for the formats of a Spec.

Opts is a list of:

  • {abbrev, NumChars} - NumChars truncates the commit hash (must be less then 40)

When a reference refers to a single object, an ok tuple with a binary string of the commit hash is returned. When it refers to a range (e.g. HEAD..HEAD~2), a map is returned with from and to keys. When using a Symmetric Difference Notation (i.e. HEAD...HEAD~4), a map with three keys from, to, and merge_base is returned.

Examples:

2> git:rev_parse(R,~"HEAD~4", [{abbrev, 7}]).
{ok,~"6d6f662"}
3> git:rev_parse(R,~"HEAD..HEAD~4", [{abbrev, 7}]).
#{from => ~"f791f01",to => ~"6d6f662"}
4> git:rev_parse(R,~"HEAD...HEAD~4", [{abbrev, 7}]).
#{from => ~"f791f01",merge_base => ~"6d6f662", to => ~"6d6f662"}

revert(Repo, CommitOID)

-spec revert(repository(), string() | binary()) -> ok | {conflict, [binary()]} | {error, term()}.

Revert a commit (creates new commit undoing the changes). Returns ok' on success,{conflict, Conflicts}' on merge conflict.

stash_apply(Repo, Index)

-spec stash_apply(repository(), integer()) -> ok | {conflict, [binary()]} | {error, term()}.

Apply a stash without removing it. Returns ok' on success,{conflict, Conflicts}' on conflict.

stash_drop(Repo, Index)

-spec stash_drop(repository(), integer()) -> ok | {error, term()}.

Delete a stash.

stash_list(Repo)

-spec stash_list(repository()) -> [{integer(), binary()}].

List all stashed changes. Returns list of {Index, Name} tuples.

stash_pop(Repo, Index)

-spec stash_pop(repository(), integer()) -> ok | {conflict, [binary()]} | {error, term()}.

Apply and remove a stash. Returns ok' on success,{conflict, Conflicts}' on conflict.

stash_save(Repo, Message)

-spec stash_save(repository(), string() | binary()) -> {ok, binary()} | {error, term()}.

Save uncommitted changes to stash. Returns {ok, StashOID}' or{error, no_changes}' if nothing to stash.

status(Repo)

-spec status(repository()) -> map() | {error, term()}.

Get repository status

status(Repo, Opts)

-spec status(repository(), status_opts()) -> map() | {error, term()}.

Get repository status

tag_create(Repo, Tag)

-spec tag_create(repository(), string() | binary()) -> ok | {error, binary() | atom()}.

Create a tag

tag_create(Repo, Tag, Msg)

-spec tag_create(repository(), string() | binary(), nil | string() | binary()) ->
                    ok | {error, binary() | atom()}.

Create a tag

tag_create/4

-spec tag_create(repository(), string() | binary(), nil | string() | binary(), tag_opts()) ->
                    ok | {error, binary() | atom()}.

Create a tag

tag_delete(Repo, Tag)

-spec tag_delete(repository(), string() | binary()) -> ok | {error, binary() | atom()}.

Delete a tag