Now that we have set up our own Git hosting and created a new user account, we can start using our Git hosting by creating a new Git repository.
This recipe uses the GitLab setup. Make sure that you have followed the previous recipe and installed your GitLab server.
Log in with your user account on the GitLab server. You can choose the admin account, but a normal user account is recommended.
If you need to use SSH to clone and push to your repositories, you will need to set up your SSH key. From the dashboard, click on Profile Settings and then select SSH Keys to add a new SSH key. Check Chapter 2, Networking, for more details on how to create an SSH key.
In the previous recipe, we learned how to create a local repository and then push it to the remote. Here, we will first create a remote or hosted repository and then clone it to our local system:
A URL for your repository is listed, with some details on how to use your new repository. You can use HTTP URL if you have not set up SSH keys. Additionally, you may need to replace the hostname with the server IP from the repository URL:
When you clone the private repository using its HTTP URL, a local Git daemon will ask you for the username and password details for authentication.