LinuxCommandLibrary

git-info

Display information about a Git repository

TLDR

Display remote locations, remote and local branches, most recent commit data and .git/config settings

$ git info
copy

Display remote locations, remote and local branches and most recent commit data
$ git info --no-config
copy

SYNOPSIS

git info [options]

PARAMETERS

-b, --branch
    Display the current branch name.

-c, --commit
    Display the latest commit hash.

-d, --dirty
    Indicate whether the repository has uncommitted changes.

-r, --remote
    Display the remote URL (if any).

-t, --tag
    Display the current tag (if any).

--version
    Display the version of git-info.

-h, --help
    Display help message.

DESCRIPTION

The `git-info` command is a utility designed to easily extract and display various details about a Git repository. It aims to provide a quick overview of the repository's status, branch information, commit history, and configuration settings. It's particularly useful for scripting and automation where parsing the raw output of individual `git` commands can be cumbersome.

Unlike some other git helper scripts, `git-info` is intended to be relatively self-contained and rely primarily on standard `git` commands. The specific information it displays can often be customized using configuration options or environment variables. A typical use case is to include repository information in build scripts, deployment logs, or application dashboards to help with debugging and tracking.

The command helps you rapidly check the status of your repository.

CAVEATS

The availability and exact output of `git-info` can depend on the specific environment and configuration of Git.

EXAMPLES

Example 1: Display current branch and latest commit:
git info -b -c

Example 2: Check if the repository is dirty:
git info -d

SEE ALSO

Copied to clipboard