For me this was due to Source Tree added the following in my .gitConfig file
[safe] bareRepository = explicit
removing this from .gitConfig solved the problem.
To open .gitConfig run the following command on your terminal
open ~/.gitconfig