# ERROR: VCS install did not find a branch or tag to checkout. The repository at 'https://github.com/user/repo.git' has no branches or tags.

- **ID:** `pip/vcs-install-no-branch-tag`
- **Domain:** pip
- **Category:** install_error
- **Error Code:** `ERROR`
- **Verification:** ai_generated
- **Fix Rate:** 75%

## Root Cause

A Git repository specified in a pip VCS requirement (e.g., git+https://...) is empty or has no commits, branches, or tags, so pip cannot determine which revision to checkout.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| pip 23.1 | active | — | — |
| pip 23.2 | active | — | — |
| pip 24.0 | active | — | — |

## Workarounds

1. **Initialize the repository with at least one commit and a branch: git init; git add .; git commit -m 'initial'; git branch -M main; git push -u origin main** (85% success)
   ```
   Initialize the repository with at least one commit and a branch: git init; git add .; git commit -m 'initial'; git branch -M main; git push -u origin main
   ```
2. **Use a local path install instead of VCS: pip install /path/to/local/repo** (90% success)
   ```
   Use a local path install instead of VCS: pip install /path/to/local/repo
   ```
3. **Specify a commit hash explicitly with @: pip install git+https://github.com/user/repo.git@abc123def456** (80% success)
   ```
   Specify a commit hash explicitly with @: pip install git+https://github.com/user/repo.git@abc123def456
   ```

## Dead Ends

- **** — Pip cannot checkout a branch that does not exist in the remote repository. (70% fail)
- **** — Local path installs work, but the error is about VCS specifically; the workaround requires using a local path correctly. (40% fail)
