A complete command-line tool for working with txtar format archives, supporting packing, unpacking, listing, and comparing operations with Git integration.
- pack: Pack directories or Git changesets into txtar format
- unpack: Safely unpack txtar archives to filesystem
- list: List files in a txtar archive
- diff: Compare two archives or directory with archive
go install github.com/phlv/txtar@latestOr build from source:
git clone https://github.com/phlv/txtar.git
cd txtar
go build -o txtarPack a directory into txtar format:
txtar pack --exclude "*.log" -o archive.txtarPack with Git integration:
txtar pack --git --since=1 -o delta.txtarPack staged changes:
txtar pack --git --staged -o staged.txtarUnpack with backup:
txtar unpack --backup --dir /output archive.txtarDry-run to preview operations:
txtar unpack --dry-run archive.txtarList archive contents:
txtar list archive.txtarFrom stdin:
cat archive.txtar | txtar listCompare two archives:
txtar diff left.txtar right.txtarCompare directory with archive:
txtar diff --dir ./src archive.txtarCreate ~/.config/txtar/config.yaml:
pack:
default_exclude:
- "*.log"
- "node_modules/"
- ".git/"
ignore_binary: true
unpack:
backup: false
dir: "./out"See .config.yaml.example and .txtarignore.example for configuration examples.
go test ./...MIT