<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect2 SYSTEM "../../../dtd/dblite.dtd">

<sect2 lang="en" id="git-show-index(1)">
    <title>git-show-index(1)</title>
    <date>2024-07-02</date>
<revhistory><revision><date>2024-07-02</date></revision></revhistory>
<indexterm>
<primary>git-show-index(1)</primary>
</indexterm>
<simplesect id="git-show-index(1)__name">
<title>NAME</title>
<simpara>git-show-index - Show packed archive index</simpara>
</simplesect>
<simplesect id="git-show-index(1)__synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git show-index</emphasis> [--object-format=&lt;hash-algorithm&gt;]</literallayout>
</blockquote>
</simplesect>
<simplesect id="git-show-index(1)__description">
<title>DESCRIPTION</title>
<simpara>Read the <emphasis>.idx</emphasis> file for a Git packfile (created with
<xref linkend="git-pack-objects(1)" /> or <xref linkend="git-index-pack(1)" />) from the
standard input, and dump its contents. The output consists of one object
per line, with each line containing two or three space-separated
columns:</simpara>
<itemizedlist>
<listitem>
<simpara>
the first column is the offset in bytes of the object within the
    corresponding packfile
</simpara>
</listitem>
<listitem>
<simpara>
the second column is the object id of the object
</simpara>
</listitem>
<listitem>
<simpara>
if the index version is 2 or higher, the third column contains the
    CRC32 of the object data
</simpara>
</listitem>
</itemizedlist>
<simpara>The objects are output in the order in which they are found in the index
file, which should be (in a correctly constructed file) sorted by object
id.</simpara>
<simpara>Note that you can get more information on a packfile by calling
<xref linkend="git-verify-pack(1)" />. However, as this command considers only the
index file itself, it's both faster and more flexible.</simpara>
</simplesect>
<simplesect id="git-show-index(1)__options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
--object-format=&lt;hash-algorithm&gt;
</term>
<listitem>
<simpara>
        Specify the given object format (hash algorithm) for the index file.  The
        valid values are <emphasis>sha1</emphasis> and (if enabled) <emphasis>sha256</emphasis>.  The default is the
        algorithm for the current repository (set by <emphasis>extensions.objectFormat</emphasis>), or
        <emphasis>sha1</emphasis> if no value is set or outside a repository..
</simpara>
<simpara>Note: At present, there is no interoperability between SHA-256
repositories and SHA-1 repositories.</simpara>
</listitem>
</varlistentry>
</variablelist>
<simpara>Historically, we warned that SHA-256 repositories may later need
backward incompatible changes when we introduce such interoperability
features. Today, we only expect compatible changes. Furthermore, if such
changes prove to be necessary, it can be expected that SHA-256 repositories
created with today's Git will be usable by future versions of Git
without data loss.</simpara>
</simplesect>
<simplesect id="git-show-index(1)__git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
</simplesect>
</sect2>
