Git – Creating Repository From Scratch – POFTUT

Git – Creating Repository From Scratch

In this chapter we will create users those will be use Git. Create an Git repository and add some code.

Create Users for Git

To use git we need some system users. If we have allready this users we can skip this but if not we will create new users. We will create users for Linux but Windows side is easy to accomplish.

First create a group for developers to sum all developers in this group.

Then create a user by adding to this group named dev

Create password for the new user

BAD PASSWORD is for the password length we have used simple password to make things easy but in real systems use strength password.

Initialize Git Repository

We change our user from root to john.

We change our current working directory to the john’s home directory

echo '

We create a directory for our project named myproject.

We open myproject directory and check current path.

End we can create an empty git repository in this directory

LEARN MORE  How To Add New Repository To Apt In Linux?

Repository is the location where directory and related files reside. If we list files in the initialized path we can see that a hidden directory named .git is created. It is the core where magic happens.

We have completed the startup of our git repository. Next Chapter we will start working with our project and codes.

Deleting Git Repository

Git repository can be easily deleted without affecting any project file in the current working directory. We know that all git related files reside in the .git hidden folder. So deleting it simple like below will remove git repository.

This is same as undo git init command.

Leave a Reply

Your email address will not be published. Required fields are marked *