Installing pgit
Install the pgit CLI with Go, a prebuilt binary, or a system package, then verify the one runtime requirement.
Installing pgit
pgit ships as a single static binary. Installing it is quick; the one thing to get right is the runtime requirement, because the local database lives in a container.
Requirements
- Docker or Podman. pgit runs PostgreSQL (with pg-xpatch) in a container for the local database. One of the two must be installed and working.
- git, only if you plan to
importan existing repository. Import shells out togit fast-export. - A pg-xpatch PostgreSQL server, only for remote
push/pull/clone. The local container already includes pg-xpatch, so you do not need a separate server for local use.
pg-xpatch is a compiled PostgreSQL extension. Bundling and cross-compiling it for every OS proved impractical, so pgit leans on a prebuilt image (ghcr.io/imgajeed76/pg-xpatch) instead. The trade-off buys reliable cross-platform behaviour for the cost of a container runtime.
Install the CLI
go install github.com/imgajeed76/pgit/v4/cmd/pgit@latestThe binary lands in your Go bin directory (usually ~/go/bin). Make sure that directory is on your PATH.
Download the archive for your platform from the releases page, unpack it, and put pgit somewhere on your PATH.
- Linux:
pgit_*_linux_amd64.tar.gzorpgit_*_linux_arm64.tar.gz - macOS:
pgit_*_darwin_amd64.tar.gzorpgit_*_darwin_arm64.tar.gz - Windows:
pgit_*_windows_amd64.zip
Grab the package matching your distro from the releases page, then:
# Debian / Ubuntusudo dpkg -i pgit_*_linux_amd64.deb# RHEL / Fedorasudo rpm -i pgit_*_linux_amd64.rpm# Alpinesudo apk add --allow-untrusted pgit_*_linux_amd64.apkPackages install the binary to /usr/bin/pgit.
Confirm the binary runs:
pgit versionPick a container runtime
pgit auto-detects the runtime. It prefers Docker and falls back to Podman. To force one, set PGIT_CONTAINER_RUNTIME:
export PGIT_CONTAINER_RUNTIME=podman # or dockerVerify your setup
pgit doctor runs through everything pgit needs and tells you what, if anything, is missing.
First run
Check the runtime and overall health:
pgit doctorIt reports the container runtime and version, container status, and (inside a repo) the database connection and your commit identity.
Start the local database container:
pgit local startThe first start pulls the pg-xpatch image and brings PostgreSQL up on port 5433 (bound to localhost). A later import or commit would start it for you anyway, so this step is optional but reassuring.
You are ready. Head to the quickstart to import a repo.
pgit generates completions for bash, zsh, fish, and PowerShell. For example: pgit completion zsh > "${fpath[1]}/_pgit". Run pgit completion --help for the per-shell install line.
Next
Import a real repository and run your first analysis.
Start, stop, update, and reset the shared database container.
Hat das auf deinem Setup funktioniert?
Noch nicht bewertet