Create an EMPTY repository on github, with your package name followed by .jl. For example:
https://github.com/lmiq/MyPackage.jl
using PkgTemplates
tpl = Template(user="lmiq")
tpl("MyPackage")This will create the .julia/dev/MyPackage directory with the content inside.
Navigate to the package directory, and push the content:
cd ~/.julia/dev/MyPackage
git push --set-upstream origin main
(main was master in older github repositories)
(From: this thread). Another useful post, with some additional information on how to create the package using the Github Desktop, is available here.