# `Git.Remotes`
[🔗](https://github.com/joshrotenberg/git_wrapper_ex/blob/main/lib/git/remotes.ex#L1)

Higher-level remote management helpers that compose lower-level `Git` functions.

Provides convenience functions for listing, adding, removing, and updating
git remotes.

All functions accept an optional keyword list. Use `:config` to specify the
repository via a `Git.Config` struct; when omitted a default config is built
from the environment.

# `add`

```elixir
@spec add(String.t(), String.t(), keyword()) :: {:ok, :done} | {:error, term()}
```

Adds a remote.

Uses `Git.remote(add_name: name, add_url: url)`.

Returns `{:ok, :done}` on success.

# `list_detailed`

```elixir
@spec list_detailed(keyword()) :: {:ok, [Git.Remote.t()]} | {:error, term()}
```

Lists remotes with their URLs.

Delegates to `Git.remote/1` which returns verbose output by default.

Returns `{:ok, [Git.Remote.t()]}`.

# `prune`

```elixir
@spec prune(
  String.t(),
  keyword()
) :: {:ok, :done} | {:error, term()}
```

Prunes stale remote-tracking branches for a remote.

Uses `Git.fetch(remote: name, prune: true)`.

Returns `{:ok, :done}` on success.

# `remove`

```elixir
@spec remove(
  String.t(),
  keyword()
) :: {:ok, :done} | {:error, term()}
```

Removes a remote.

Uses `Git.remote(remove: name)`.

Returns `{:ok, :done}` on success.

# `set_url`

```elixir
@spec set_url(String.t(), String.t(), keyword()) :: {:ok, :done} | {:error, term()}
```

Updates the URL of an existing remote.

Uses `git remote set-url` via raw `System.cmd` since the command module
does not expose a set-url option.

Returns `{:ok, :done}` on success.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
