How to create a repository in GIT?

To build a Git repository, simply log in to your Hostginger hosting account through SSH and enter the following command:

git init repository

Replace repository with the name of the directory where you wish to create the repository (the git init command creates the directory if it does not already exist).
Change the current working directory to the new repository:

cd repository

Type the following command to take a snapshot of all the files presently in the repository directory:

git add .

The git add command places the files in a temporary staging region known as the "index" in Git.
Type the following command to permanently commit the files to the repository:

git commit

A text editor opens, and you can type a commit message that describes the changes. Save the message, and then Git adds the changes to the repository.
 
 
 
Was this answer helpful?

Related Articles

How to make changes in repository?

Git makes it simple to update a repository. Using the git add command, you can update Git's file...

What is GIT?

All Hostginger Hosting Wordpress and Cloud accounts include the popular Git version control...

How to merge changes from one branch to another branch?

Type the following command to merge modifications from one branch into another. Replace name with...

How to clone a repository?

It is possible to "clone" repositories. Git creates an exact replica of an existing repository...

How to configure a GIT Client to work with a GIT Repository?

After you build a repository on your Hostginger Hosting account, you'll certainly want to be able...