{"id":31628068,"url":"https://github.com/jirutka/git-metafile","last_synced_at":"2025-10-06T20:17:39.561Z","repository":{"id":9695080,"uuid":"63019762","full_name":"jirutka/git-metafile","owner":"jirutka","description":"Store and restore files metadata (mode, owner, group) in a git repository","archived":false,"fork":false,"pushed_at":"2024-09-03T22:11:57.000Z","size":86,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-08T07:26:55.654Z","etag":null,"topics":["git","linux","metadata","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jirutka.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-10T21:47:20.000Z","updated_at":"2024-11-15T18:57:03.000Z","dependencies_parsed_at":"2024-06-20T16:29:18.230Z","dependency_job_id":"f3994956-1436-4a37-a4d4-1f6abccefb90","html_url":"https://github.com/jirutka/git-metafile","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jirutka/git-metafile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirutka%2Fgit-metafile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirutka%2Fgit-metafile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirutka%2Fgit-metafile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirutka%2Fgit-metafile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jirutka","download_url":"https://codeload.github.com/jirutka/git-metafile/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jirutka%2Fgit-metafile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278672041,"owners_count":26025826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","linux","metadata","rust"],"created_at":"2025-10-06T20:17:37.363Z","updated_at":"2025-10-06T20:17:39.556Z","avatar_url":"https://github.com/jirutka.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Git Metafile\nJakub Jirutka \u003chttps://github.com/jirutka[@jirutka]\u003e\n//custom\n:name: git-metafile\n:version: 0.2.3\n:gh-name: jirutka/{name}\n:gh-branch: master\n:releases-uri: https://github.com/{gh-name}/releases/download/v{version}\n\nifdef::env-github[]\nimage:https://github.com/{gh-name}/workflows/CI/badge.svg[CI Status, link=https://github.com/{gh-name}/actions?query=workflow%3A%22CI%22]\nimage:https://img.shields.io/crates/v/{name}.svg[Version on crates.io, link=https://crates.io/crates/{name}]\nimage:https://repology.org/badge/tiny-repos/{name}.svg[Packaging status, link=https://repology.org/project/{name}]\nendif::env-github[]\n\nA simple tool for storing and restoring complete files metadata (mode, owner, group) in a git repository.\nIt’s designed especially for versioning /etc.\n\nMetadata is tracked using the `.metafile` file, which is automatically updated and added to commits.\nThis file is in TSV (tab-separated values) format to be easily readable and diffable.\n\n._Sample .metafile_\n[source]\n----\n#%GIT-METAFILE 1\n# \u003cpath\u003e\t\u003cmode\u003e\t\u003cuid\u003e\t\u003cgid\u003e\n.gitignore\t100644\t0\t0\n.metafile\t100644\t0\t0\nprofile.d\t40755\t0\t0\nshadow\t100640\t0\t42\n----\n\n\n== Installation\n\n=== On Alpine Linux\n\nIf you’re using *Alpine Linux*, you can install https://pkgs.alpinelinux.org/packages?name={name}[{name}] package from the Alpine’s community repository:\n\n[source, sh, subs=\"+attributes\"]\napk add {name}\n\n\n=== On Arch Linux\n\nIf you’re using *Arch Linux*, you can install https://aur.archlinux.org/packages/{name}[{name}] package from https://aur.archlinux.org/[AUR]:\n\n[source, sh, subs=\"+attributes\"]\nyay -S {name}\n\nOr use another AUR helper.\n\n\n=== Using cargo\n\nIf you’re a *Rust developer*, you can build and install https://crates.io/crates/{name}[{name}] from https://crates.io/[crates.io] using `cargo`:\n\n[source, sh, subs=\"+attributes\"]\ncargo install {name}\n\nNote that the binary may be bigger than expected because it contains debug symbols.\nTo remove debug symbols and therefore reduce the file size, run `strip` on the binary.\n\n\n=== Using pre-built binary\n\nIf your package manager doesn’t provide {name}, you can use a pre-built binary.\n\nOn Linux, you can choose either a statically linked footnote:[Statically linked with http://www.musl-libc.org/[musl libc]] *(static)* binary that should work on every Linux system (distro), or, if you’re using a sufficient recent GNU/libc-based *(glibc)* distro (most major distros), a dynamically linked binary.\n\n____\n🐧 *Linux (static)*:\n{releases-uri}/{name}-{version}-x86_64-linux.tar.gz[[x86_64\\]]\n{releases-uri}/{name}-{version}-aarch64-linux.tar.gz[[aarch64\\]]\n{releases-uri}/{name}-{version}-armv7-linux.tar.gz[[armv7\\]] +\n🐧 *Linux (glibc)*:{nbsp}\n{releases-uri}/{name}-{version}-x86_64-linux-gnu.tar.gz[[x86_64\\]]\n{releases-uri}/{name}-{version}-powerpc64le-linux-gnu.tar.gz[[ppc64le\\]]\n{releases-uri}/{name}-{version}-riscv64gc-linux-gnu.tar.gz[[riscv64gc\\]] +\n *macOS*:\n{releases-uri}/{name}-{version}-x86_64-apple-darwin.tar.gz[[x86_64\\]]\n{releases-uri}/{name}-{version}-aarch64-apple-darwin.tar.gz[[aarch64\\]]footnote:[aarch64-apple-darwin is so called “Apple Silicon”.]\n____\n\n. Install git (use your system’s package manager).\n\n. Download and extract release tarball for your OS and CPU architecture (pick the right link from the list above):\n+\n[source, sh, subs=\"verbatim, attributes\"]\n----\ncurl -sSLO {releases-uri}/{name}-{version}-x86_64-linux.tar.gz\ncurl -sSL {releases-uri}/checksums.txt | sha256sum -c --ignore-missing\ntar -xzf {name}-{version}-*.tar.gz\n----\n\n. Install `{name}` somewhere on your `PATH`, e.g. `/usr/local/bin`:\n+\n[source, sh, subs=\"verbatim, attributes\"]\ninstall -m 755 {name}-{version}-*/{name} /usr/local/bin/\n\n\n=== From source tarball\n\n. Install git (use your system’s package manager).\n\n. Download and unpack the tarball:\n+\n[source, sh, subs=\"+attributes\"]\n----\nwget https://github.com/{gh-name}/archive/v{version}/{name}-{version}.tar.gz\ntar -xzf {name}-{version}.tar.gz\ncd {name}-{version}\n----\n\n. Build {name} using cargo:\n+\n[source, sh]\ncargo build --release --locked\n\n. Grab the binary from `target/release/{name}` and install it somewhere on your `PATH`, e.g. `/usr/local/bin`:\n+\n[source, sh, subs=\"+attributes\"]\ninstall -D -m755 target/release/{name} -t /usr/local/bin/\n\n\n== How to use\n\nTo automatically record files attributes on every commit and restore them on every checkout, set up git hooks:\n\n[source, sh]\n----\ncat \u003e\u003e .git/hooks/pre-commit \u003c\u003cEOF\n#!/bin/sh\n\ngit-metafile save \u0026\u0026 git add .metafile\nEOF\n\nchmod +x .git/hooks/pre-commit\n\ncat \u003e\u003e .git/hooks/post-checkout \u003c\u003cEOF\n#!/bin/sh\n\ngit-metafile apply\nEOF\n\nchmod +x .git/hooks/post-checkout\nln -s post-checkout .git/hooks/post-rewrite\n----\n\nThis should work for all basic operations, so you don’t need to think about it anymore.\nHowever, you have to be careful when rebasing – no hook is run when git checkouts files during rebase and _before_ committing changes done in rebase mode!\n\nTo record changes or restore files attributes manually, you can run `git metafile save` or `git metafile apply` respectively.\n\n\n== License\n\nThis project is licensed under http://opensource.org/licenses/MIT/[MIT License].\nFor the full text of the license, see the link:LICENSE[LICENSE] file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjirutka%2Fgit-metafile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjirutka%2Fgit-metafile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjirutka%2Fgit-metafile/lists"}