I come across this error while uploading project lớn gitlab. I didn't clone from git but instead upload project. For pushing your code lớn gitlab you have two ways either using ssh or https. If you use https you have lớn enter username and password of gitlab tài khoản. For pushing you code lớn git you can use following one.
Pushing lớn Git for the first time
>$ cd
>$ mkdir .ssh;cd .ssh
>$ ssh-keygen -o -t rsa -b 4096 -C "[email protected]"
The -C parameter is optional, it provides a comment at the over of your key lớn distinguish it from others if you have multiple. This will create id_rsa (your private key) and id_rsa.pub (your public key). We pass our public key around and keep our private key — well, private. Gitlab’s User Settings is where you would then add your public key lớn your account, allowing us lớn finally push.
In your project location(Directory) use below command
git init
It Transform the current directory into a Git repository. This adds a .git subdirectory lớn the current directory and makes it possible lớn start recording revisions of the project.
Push Using https path
git push --set-upstream https://gitlab.com/Account_User_Name/Your_Project_Name.git master
Push Using ssh path
git push --set-upstream [email protected]:Account_User_Name/Your_project_Name.git master
— set-upstream: tells git the path lớn origin. If Git has previously pushed on your current branch, it will remember where origin is
master: this is the name of the branch I want lớn push lớn when initializing