> 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/ida-9.5/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**](/ida-9.5/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 keeps repository size under control. A separate diff driver, also registered by `git-ida`, is what makes `git diff` produce a readable comparison. See [Diffing IDA databases with `git diff`](/ida-9.5/add-ons/teams/how-tos/git-diff.md) for details.

{% hint style="warning" %}
**Storage, transport, and diffing of databases** is what `git-ida` handles, running IDA itself behind the scenes. **Resolving content conflicts is always done in IDA's merge view.** See [Diffing IDA databases with `git diff`](/ida-9.5/add-ons/teams/how-tos/git-diff.md) for how `git diff` produces a readable, structural diff, and [Merging and automerging](/ida-9.5/add-ons/teams/concepts/git.md#automerging-and-merging) for how conflicts are resolved.
{% endhint %}

***

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

Run this once per machine:

```bash
git ida install
```

This registers `git-ida`'s filter, merge, and diff drivers in your **global** Git config. After this, any `git clone` of a `git-ida` repository, even one made outside IDA, checks out real databases right away, no per-repository setup needed. IDA runs this automatically the first time its Git integration runs, so most users never need to run it by hand.

{% hint style="info" %}
Install Git LFS **first** if you want to benefit from the chunked store for large databases. See [Large File Storage (LFS)](/ida-9.5/add-ons/teams/concepts/git.md#large-file-storage-lfs).
{% endhint %}

Run it again inside an existing clone to repair one that checked out databases as small placeholder stubs instead of real files, for example a clone made before `git ida install` existed on that machine. `git ida uninstall` removes the global registration.

**Check whether it's already set up:**

```bash
git ida version
```

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

If you instead get an error like `'ida' is not a git command`, `git ida install` is not available on this `git-ida` version, or not yet on your `PATH`. Pick one of the two fallbacks below.

### Fallback: 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.

### Fallback: 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 neither `git ida install` nor your `PATH` already make `git-ida` reachable.
{% 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` for you automatically when you create a repository through the GUI (**Teams → Create Repository**). Cloning doesn't need it, `git ida install` (above) is all a clone requires. **Run it yourself only when you set up a repository from the command line, outside of IDA**.
{% endhint %}

Unlike `git ida install` above, which is a one-time, per-machine setup, `git ida initialize` configures one specific repository: 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 install                 # one-time, per-machine setup (global filter/merge/diff drivers)
git ida uninstall               # reverse it
git ida version                 # verify git-ida is reachable
git ida initialize              # set up IDA support in one 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>

# fallback if git ida install isn't available:
export PATH="$PATH:/path/to/ida/tools/teams"            # add tools/teams to PATH
git config --global alias.ida '!"/path/to/ida/tools/teams/git-ida"'  # or define an alias
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
