In what version of Git did git-status get the –branch option?

In the latest version of git you can use the flag –branch (or -b) to “Show the branch and tracking info even in short-format.”

When (which version) did git introduce this option? I know that at least in it isn’t an option.

  • How do I install the Git man pages on OS X?
  • what are some tools for documenting code changes?
  • Suggestions for a good commit message: format/guideline?
  • Embedding images inside a GitHub wiki (gollum) repository?
  • How can I set up Read the Docs so the Sphinx autodoc option works?
  • Arrows direction in ProGit book
  • How to revert Git repository to a previous commit?
  • git vs mercurial performance
  • Send build artifacts over SSH - could not create directory
  • How to use git from emacs
  • Edit a commit message in the pushed code
  • In git merge conflicts, how do I keep the version that is being merged in?
  • 2 Solutions collect form web for “In what version of Git did git-status get the –branch option?”

    The combination of git grep -F and git log --oneline -S is generally a powerful way to dig anything out of a Git repo:
    (manojlds proposes in his answer a one-liner which should work most of the time if you search for the right comment like the OP’s question does. Go upvote it).

    VonC@NETVONC ~/Prog/git/git (master)
    $ git grep -F 'Show the branch'
    Documentation/git-status.txt:   Show the branch and tracking info even in short-format.
    VonC@NETVONC ~/Prog/git/git (master)
    $ git log --oneline --follow -S'Show the branch' -- Documentation/git-status.txt
    46077fa Documentation+t5708: document and test status -s -b
    VonC@NETVONC ~/Prog/git/git (master)
    $ git tag --contains 46077fa

    So 1.7.2

    (I always found this thread a neat illustration of git digging)

    Note: It has been introduced 233 commits after 1.7.1 according to git describe:

    VonC@NETVONC ~/Prog/git/git (master)
    $ git describe 46077fa

    It was first introduced at Tue May 25 16:52:03 2010 +0200

    VonC@NETVONC ~/Prog/git/git (master)
    $ git show 46077fa
    commit 46077fa5d477a3e96e0bb96042a2a9fdc9c818cb
    Author: Michael J Gruber <>
    Date:   Tue May 25 16:52:03 2010 +0200
        Documentation+t5708: document and test status -s -b
        Signed-off-by: Michael J Gruber <>
        Signed-off-by: Junio C Hamano <>

    I usually search for the strings and look for them in the release notes ( so that you know exactly which release it was added with just one command):

    Something like this works:

    $ git grep -F "shows the current branch"
    Documentation/RelNotes/1.7.2.txt: * "git status -s -b" shows the current branch

    Clearly, it was added in 1.7.2. Of course you have to play around with the words, but you can employ regexes to find more easily.

    You can do similar search using github’s advanced search, that way, you don’t have to clone the source.

    You can do soemthing like:

    repo:git/git path:Documentation/RelNotes/* <what you want to find>

    to search the release notes online

    Git Baby is a git and github fan, let's start git clone.