Git Create Repository
Generally, users host their repository on online git management providers like Github.com, bitbucket.com, and Gitlab.com. But you can also host your repository on your server without any management tool. This is helpful for small organizations with limited git repositories.
Follow instructions to create your own bare repository and host it on your Linux server. After that clone that repository to your local system for development purposes.
Create System User
First, create a new system user, This is a good practice to have a separate user, which will be used to connect the repository to the server from client systems.
Crete Bare Repository
Now create a git bare repository. This repository will be used as a remote repository by developers. First, we are creating a project directory. After that, I will create our first git repository named app1.git inside the project directory. Try to keep the repository name ending with .git for a better naming convention.
Now use the following command to initialize the repository. Do not forget to use –the bare keyword in the command to create a bare repository.
If you list files inside the repository you will not find a directory named .git due to the bare repository, You will see their many files like below
Clone Repository
Now you can make a clone of this repository from any client's system using the following command. This will ask for the password of the git user.
In the next tutorial, you will learn how to set up key-based ssh access and clone git repositories over ssh without a password.
0 Comments
CAN FEEDBACK
Emoji