Skip to content

๐Ÿ” gittxt re Command

The re (reverse) command reconstructs the original repository structure from a Gittxt output report. This is useful when you only have .txt, .md, or .json exports and need the original source code files.


โœ… Syntax

gittxt re <report_file> [--output-dir <folder>]

๐Ÿ“‹ Description

  • Accepts .txt, .md, or .json reports generated by Gittxt.
  • Extracts all reconstructable files and places them into a structured ZIP archive.
  • Supports reports created with --lite, --no-tree, or partial content.

๐Ÿ“„ Input

Supported input formats: - .json (recommended) - .txt - .md

Each must follow Gittxt's output structure.


๐Ÿ“ฆ Output

Creates a ZIP archive containing the reconstructed project.

Output Structure

The resulting ZIP includes: - All reconstructed text files - Folder structure based on available report data


โš ๏ธ Limitations & Warnings

  • If the input report used --no-tree, the directory tree may be incomplete.
  • If the report used --lite, asset metadata and some structure may be missing.
  • File content must be intact in the report.

Warnings shown in CLI:

โš ๏ธ Note: This report did not include a directory tree. Reconstructed structure may be limited.
โš ๏ธ Note: No non-textual assets were included in this report.

๐Ÿงช Example

gittxt re reports/project.json -o ./restored

Creates: project_reconstructed_<timestamp>.zip under the default or specified --output-dir.


๐Ÿ” What Gets Reconstructed

  • Files listed in the report
  • Full paths and folder structure
  • Textual content only (no binary files)

โœ… Best Practices

  • Prefer .json for best reconstruction.
  • Validate output using the tree view or unzip locally.

Back: Clean | Next: Plugin โžก