Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a remote Git repository?

Is it possible to create a new Git repository without creating it first on http://gitlab.com? My intention is to init a local repository, do some work, add files to the index, commit and finally push it to the server without creating the new repository manually on gitlab.

Repository creation failed with an error message: GitLab: The project you were looking for could not be found. fatal: Could not read from remote repository.

when I finally do

git push origin --all
like image 372
du-it Avatar asked Mar 12 '26 15:03

du-it


1 Answers

Trying to answer the same question for myself (create a new gitlab repo from commandline and then push to it), I found this article Push to create a new project in GitLab's help pages. It worked for me running this command:

git push --set-upstream https://gitlab.example.com/myusername/nonexistent-project.git master

and then added the remote to the repo as prompted:

git remote add origin https://gitlab.example.com/myusername/nonexistent-project.git

(working for GitLab 10.5 and on)

like image 121
alexxtasi Avatar answered Mar 15 '26 06:03

alexxtasi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!