# GIT Based Versioning of Files in FAL

## Installation

Just install and activate the extension.

## Configuration

| Option | Description |
|---|---|
| `basic.ignoreDirs` | Comma separated list of directories to ignore, e.g. `/_processed_/` |
| `basic.privateKeyPath` | Path to private key, e.g. `/var/www/privatekey.pem` |
| `basic.repositoryPath` | Path for initializing git repository, e.g. `fileadmin/` |
| `basic.commitEmail ` | Email of user, who commits (if not set in BE-User) |
| `basic.commitName` | Name of user, who commits (if not set in BE-User) |

## Console Command
| Parameter | Description |
|---|---|
| `rootDirectory` | Directory where to start |
| `includeDirectories` | Comma separated list of directories to include |
| `commitName` | Name of user, who commits |
| `commitEmail ` | Email of user, who commits |

Example:
```
./vendor/bin/typo3 fileversion:commitFilesInTree /var/www/html/public/fileadmin/ "/" "Console User" "console@domain.tld"
```

## Test the Functionality

### Add File
```
commit 25b3e1b55a488a75b1b8a8d0e8c8b291e5360e34
Author: Demo User (User-ID 1) <demo@user.tld>
Date:   Mon Jul 11 14:14:06 2022 +0000

    Upload file fileadmin/logo.png
    Hash: 80ed4efd4cdcad68fb6449b04b90558964d0592510657ec1e2d252f450ced91f
```

### Move File
```
commit b32063d420c538da34e6f6821e5ee2a0f54fb425
Author: Demo User (User-ID 1) <demo@user.tld>
Date:   Mon Jul 11 14:20:35 2022 +0000

    Move file fileadmin/logo.png to fileadmin/subdir/logo.png
    Hash: 80ed4efd4cdcad68fb6449b04b90558964d0592510657ec1e2d252f450ced91f
```

### Delete File
```
commit 2b109bdfb2b78d3c1d2a000dc27e2939274e0be0
Author: Demo User (User-ID 1) <demo@user.tld>
Date:   Mon Jul 11 14:21:30 2022 +0000

    Delete file fileadmin/subdir/logo.png
```

### Copy File
```
commit fa29827fb0cb37b4d2aa00732e28cf0d6d50a716
Author: Demo User (User-ID 1) <demo@user.tld>
Date:   Mon Jul 11 14:23:22 2022 +0000

    Copy file fileadmin/logo.png to fileadmin/subdir/logo.png
    Hash: 80ed4efd4cdcad68fb6449b04b90558964d0592510657ec1e2d252f450ced91f
```

### Create File
```
commit cfa051b3c09018d2cb5375fd9b0cf776d56339f3
Author: Demo User (User-ID 1) <demo@user.tld>
Date:   Mon Jul 11 14:27:21 2022 +0000

    Create file fileadmin/test.txt
    Hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
```

### Overwrite File with new Content
```
commit d50c60de7dcb5a04dc29e1d4efc3f47772edd549
Author: Demo User (User-ID 1) <demo@user.tld>
Date:   Mon Jul 11 14:28:07 2022 +0000

    Overwrite file fileadmin/test.txt with new content
    Hash: f6ff35c1853f0c865b384364fd5812428603ea21bedef54121ab12d72720b83e
```

### Replace File with new Version
```
commit aa57abe393e18f3be31f1eaf41ff792431ae4c6e
Author: Demo User (User-ID 1) <demo@user.tld>
Date:   Mon Jul 11 14:30:23 2022 +0000

    Replace file fileadmin/logo.png with new version
    Hash: 4e07f8c5fbcbeed94da3ed42e5a469dae4a8646305cd8322cf5e42e2f2b30bdf
```

### Rename File
```
commit aef2f60ce13edf07d7d75a069448af1e9199f9e4
Author: Demo User (User-ID 1) <demo@user.tld>
Date:   Mon Jul 11 14:33:15 2022 +0000

    Rename file fileadmin/logo.png to fileadmin/image.png
    Hash: 4e07f8c5fbcbeed94da3ed42e5a469dae4a8646305cd8322cf5e42e2f2b30bdf
```
