> For the complete documentation index, see [llms.txt](https://docs.hex-rays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hex-rays.com/add-ons/teams/how-tos/git_ida_cli.md).

# Using git-ida from the command line

Teams stores your databases in an ordinary Git repository, so you are never locked into IDA's UI to manage them. You can `clone`, `fetch`, `pull`, `push`, `branch`, `tag`, and inspect history with the standard `git` command line or any Git client.

The one IDA-specific piece is **`git-ida`**: a small helper that lets Git store, transfer, and reconstruct packed IDA databases efficiently. This page explains how to make `git-ida` available to your shell and how to use it directly.

{% hint style="info" %}
For day-to-day work inside IDA (*Commit*, *Push*, *Pull*, etc.) see [**Working with Git**](/add-ons/teams/how-tos/working-with-git.md). This tutorial is intended for users who also want to drive the repository from a terminal or a script.
{% endhint %}

***

## What `git-ida` is

The `git-ida` binary ships with IDA and lives under `tools/teams/` in your IDA installation (`git-ida` on Linux/macOS, `git-ida.exe` on Windows).

Git invokes it as a subcommand: when you type `git ida <something>`, Git looks for an executable named `git-ida` on your `PATH` and runs it. IDA configures it as a Git **filter** so that, whenever a database is checked out or committed, Git transparently produces a clean, compact representation instead of a raw, opaque blob. That is what makes IDA databases "diffable" and keeps repository size under control.

{% hint style="warning" %}
**Storage and transport of databases** is what `git-ida` handles. **Diffing and merging the analysis itself is always done in IDA.** `git diff` on a database is not meaningful, and content conflicts must be resolved in IDA's merge view. See [Merging and automerging](/add-ons/teams/concepts/git.md#automerging-and-merging).
{% endhint %}

***

## Making `git-ida` available to your shell

The first time you use IDA with Teams add-on, IDA automatically registers `git-ida` in your global git configuration, so it works in any terminal session without manual setup.

**First, check whether it already works:**

```bash
git ida version
```

{% hint style="success" %}
If you see a version string (e.g. `git-ida 1.x.x`), you are done. Skip the rest of this section.
{% endhint %}

If you instead get an error like `'ida' is not a git command`, pick one of the two options below.

### Option A (recommended): add `tools/teams` to your `PATH`

Point your shell at IDA's `tools/teams` directory. Adjust the path to match your installation.

* Linux / macOS (add to `~/.bashrc`, `~/.zshrc`, …):

```bash
export PATH="$PATH:/path/to/ida/tools/teams"
```

* Windows (PowerShell, persistent for the current user):

```powershell
setx PATH "$env:PATH;C:\Program Files\IDA Professional 9.4\tools\teams"
```

Open a new terminal and run `git ida version` again to confirm.

### Option B: define a `git ida` alias

If you would rather not change `PATH`, register a Git alias that points directly at the bundled binary. Quote the path if it contains spaces.

```bash
git config --global alias.ida '!"/path/to/ida/tools/teams/git-ida"'
```

After this, `git ida version`, `git ida initialize`, etc. resolve through the alias regardless of `PATH`.

{% hint style="info" %}
The alias is only needed if `git ida version` does not already work. If `git-ida` is on your `PATH`, Git finds it automatically and the alias is redundant.
{% endhint %}

***

## What IDA already configured for you

When a repository is created or cloned through IDA, a few local settings are written so that command-line use behaves the same as the in-IDA workflow. Knowing they exist helps when scripting:

| Setting                           | Why it's there                                                                                                       |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `filter.*` (via `.gitattributes`) | The `git-ida` clean/smudge filter that compacts and reconstructs databases on commit/checkout.                       |
| `pull.rebase = false`             | Makes a manual `git pull` use a **merge** (the same model IDA's Pull uses), so CLI and UI pulls behave consistently. |
| `ida.path`                        | Absolute path to the IDA executable, so `git-ida` can launch IDA when a diff or merge is required.                   |
| `credential.helper`               | For HTTPS remotes, lets Git authenticate without re-prompting (credentials are stored by IDA in the OS keychain).    |

These are stored in the repository's local config (`.git/config`), so they travel with that working copy and do not affect your other repos.

***

## Everyday command-line operations

Once `git-ida` is available, the usual Git commands work as expected:

```bash
git clone <url>           # git-ida reconstructs databases on checkout
git status
git log -- malware.i64    # history for a specific database
git fetch
git pull                  # merge-style, matching IDA
git push
git switch -c experiment  # branches and tags work normally
git tag v1
```

Because the repository is a standard Git repository, third-party Git GUIs, IDE integrations, CI pipelines, and your provider's web UI all work too.

***

## Switching branches

Switching to another branch checks out a different set of databases. Git does not always re-run the `git-ida` smudge filter on files it considers unchanged, so the databases in your working copy may not be fully reconstructed after a plain `git switch` / `git checkout`.

To be safe, force Git to re-materialize every file through the filter by resetting hard to the branch tip right after switching:

```bash
git switch <branch>               # or: git checkout <branch>
git reset --hard origin/<branch>
```

This is exactly what IDA does internally after cloning a repository, and it guarantees every database on the branch is correctly rebuilt.

{% hint style="warning" %}
Running `git reset --hard` **discards uncommitted local changes**. Before running it, commit or stash your work, and make sure none of the affected databases are open in IDA (the files are about to be overwritten on disk).
{% endhint %}

***

## `git ida initialize`

{% hint style="info" %}
IDA runs `git ida initialize` automatically when you use *Create Repository* or *Clone Repository*. **Run it yourself only when you set up a repository outside of IDA**.
{% endhint %}

The `git ida initialize` command configures the current repository to handle IDA databases: it registers the `git-ida` filter, writes the `.gitattributes` and `.gitignore` entries IDA relies on, and sets up the merge driver.

For example:

```bash
# You created or cloned a repo with plain git and want IDA support in it
cd my-repo
git ida initialize
```

Useful flags:

| Flag         | Purpose                                                                                                                                                      |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--lfs`      | Track databases with **Git LFS** (recommended when databases exceed your server's file-size limit). Requires `git-lfs` to be installed.                      |
| `--override` | Re-apply the IDA configuration even if some of it is already present. Handy for repairing a repository whose `.gitattributes`/filter config got out of sync. |

```bash
git ida initialize --lfs          # enable LFS for large databases
git ida initialize --override     # re-apply / repair configuration
```

After running it, you can inspect what was set up:

```bash
cat .gitattributes        # filter / merge attributes for *.i64 / *.idb
git config --local --list # ida.* and filter.* entries
```

## Quick reference

```bash
git ida version                 # verify git-ida is reachable
git ida initialize              # set up IDA support in a repo (rarely needed manually)
git ida initialize --lfs        # ... with Git LFS for large databases
git ida initialize --override   # ... re-apply / repair configuration

# after switching branches, force the filter to rebuild every database:
git switch <branch> && git reset --hard origin/<branch>

# one-time setup so the terminal can find git-ida (fallback if auto-registration didn't work):
export PATH="$PATH:/path/to/ida/tools/teams"            # Option A (recommended)
git config --global alias.ida '!"/path/to/ida/tools/teams/git-ida"'  # Option B
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hex-rays.com/add-ons/teams/how-tos/git_ida_cli.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
