GIT-DIAGNOSE(1)

πŸ’… GIT-DIAGNOSE πŸ’…

okay so bestie, welcome to git-diagnose β€” the part of the Git manual (that's git-diagnose(1) if we're being formal) where Git basically makes a little scrapbook of everything going on with your machine πŸŽ€

✨ SYNOPSIS ✨

git diagnose [(-o | --output-directory) <path>] [(-s | --suffix) <format>]
               [--mode=<mode>]

🌸 DESCRIPTION 🌸

So here's the vibe: git diagnose goes around collecting detailed information about the user's machine, the Git client, and the current repository state, and then it packages all of that up into a zip archive. Iconic. Then you can, like, share the generated archive with the Git mailing list to help debug an issue, or just keep it as a reference for doing your own independent debugging. Main character debugging energy fr fr πŸ¦‹

By default, here's the information that gets captured in the archive:

  • git version --build-options
  • The path to the repository root
  • The available disk space on the filesystem
  • The name and size of each packfile, including those in alternate object stores
  • The total count of loose objects, as well as counts broken down by .git/objects subdirectory

You can collect additional information by selecting a different diagnostic mode using the --mode option ✨

Also important, bestie β€” this tool differs from git-bugreport(1) in that it collects much more detailed information, with a greater focus on reporting the size and data shape of repository contents. Like, bugreport is cute but diagnose is thorough πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • -o <path>, --output-directory <path> β€” puts the resulting diagnostics archive in <path> instead of the current directory. Very "I have a folder for this" of you 🫢
  • -s <format>, --suffix <format> β€” lets you specify an alternate suffix for the diagnostics archive name, so you get a file named git-diagnostics-<formatted-suffix>. This should take the form of a strftime(3) format string, and the current local time will be used. Cute timestamped archive, we love to see it ⭐
  • --mode=(stats|all) β€” specifies the type of diagnostics that should be collected. The default behavior of git diagnose is equivalent to --mode=stats ✨

The --mode=all option collects everything included in --mode=stats, as well as copies of .git, .git/hooks, .git/info, .git/logs, and .git/objects/info directories.

🚨 okay so listen β€” this additional information may be sensitive, because it can be used to reconstruct the full contents of the diagnosed repository. Users should exercise caution when sharing an archive generated with --mode=all. Like, do NOT just drop that in the group chat, bestie 😭 think before you share πŸ’€

πŸ‘‘ GIT πŸ‘‘

Part of the git(1) suite 🌈


and that's the whole page, bestie 🧚 this gorgeous little manual is from Git 2.56.0, dated 2026-09-27 β€” slay, go diagnose something πŸ’–

πŸ“¦ where this page comes from