I was getting started for the first time on SPM yesterday and didn't understand the errors I was getting when trying to consume the package I created. Spent a day hitting my head on a wall... Thank you @minoo555!!
I just had this issue too and it was SourceTree that added the bareRepository = explicit that made it not work (see the link to the Atlassian bug posted above)
Deleting this won't solve the problem - Sourcetree will add it next time you use it. You also need to go to Settings in Sourcetree and deselect "Allow Sourcetree to modify your global Mercurial and Git configuration files".