A git repository doesn't have to be public, though you do have to pay for private repositories on GitHub. GitHub is great for the "network effects" of it having a lot of developers on there, maybe wanting to help out with your (public) software, but if you just want some free, private Git hosting, https://bitbucket.org is fine.