# How to Move a Complete Git Repository

Moving a Git repository while preserving all branches, tags, and history requires careful handling. This guide covers the step-by-step process to migrate your repository safely.

## Quick Method

For those familiar with Git, here's the quick version:

```bash
git clone --mirror $ORIG_REPO_URL temp-dir
cd temp-dir
git remote rm origin
git remote add origin $NEW_REPO_URL
git push origin --all
git push --tags
```

## Detailed Steps

1. **Clone the Original Repository**
    
    ```bash
    git clone --mirror $ORIG_REPO_URL temp-dir
    ```
    
    The `--mirror` flag creates a bare repository, including all branches and tags.
    
2. **Navigate to Directory**
    
    ```bash
    cd temp-dir
    ```
    
3. **Update Remote Configuration**
    
    ```bash
    git remote rm origin
    git remote add origin $NEW_REPO_URL
    ```
    
    This step redirects the repository to its new destination.
    
4. **Push All Content**
    
    ```bash
    git push origin --all
    git push --tags
    ```
    
    These commands transfer all branches and tags to the new location.
    

## Verification

After migration, verify:

* All branches are present in the new repository
    
* Commit history is intact
    
* Tags are properly transferred
    
* Remote URLs are correctly configured
