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.

  • subversion python bindings documentation?
  • deployable wiki-based documentation
  • what are some tools for documenting code changes?
  • Use forever-branches or directories for project related documentation, wireframes, designs, etc.?
  • What does (whatever)* construct mean in Git manual pages?
  • git bash ssh-keygen documentation
  • Git: how do *you* use it?/dummies tutorial
  • How can a pre-commit git hook runs rspec tests and prevent a commit?
  • Git clone with username password authentication in one go
  • Preventing a file overwrite with Git
  • Remove a git commit which has not pushed
  • How to get a count of all the files in a git repository?
  • 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.