Create repository and subgroups by CLI and Gitlab 14

I know that by pushing to git, if the project does not exist, it will be created.

I have to accomplish the same task if the project should be relocated under some subgroup which does not yet exist, for example git push --set-upstream

In that scenario the push fails due to the my-group which does not exist.

How can I accomplish that task?

Thank you so much!