I am very new to macOS, knowing Ubuntu a little bit, and am wondering whether git is pre-installed on macOS or not. Typing

which -a git

results in

git is /usr/bin/git

But when I init a test-repo and checkout a myBranch, the command

git branch

results in a empty line. So is there anything I do forget? I installed Homebrew before checking for git, so maybe this causes some interdependencies?


macOS does come with git preinstalled, at /usr/bin/git, noted by the ‘Apple Git’.

$ /usr/bin/git --version
git version 2.13.5 (Apple Git-94)

If git is installed using Homebrew, it will be at /usr/local/bin/git.

| improve this answer | |
  • 1
    Thanks for the quick answer! Do you have any suggestions which git to use? I tried to add the current git-branch to my terminal prompt like described here, but this resulted in some errors, where always $(parse_git_bash) was written behind the standard prompt. – marco05772 Oct 31 '17 at 13:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .