As this is the first thing that comes up on Google when searching this error, I wanted to add the answer I found that worked when I stumbled upon this issue.
In short: I didnt have write access to the repo.
This could be the same reason as from this post: https://answers.atlassian.com/questions/125892/submodule-with-different-user-fails-to-clone-push-with-sourcetree
In short, it might be because you're using HTTPS authentication and not specifying your username in the URL. Have a read and see if it helps.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs