Create a Git repository

You can create git repository from following two ways.

  1. Create new repository from scratch.
  2. Create new repository from an existing project.

Create new repository from scratch.

In this case you are about to start some project.

  1. Create a directory to contain the project files.
  2. Go to the new directory.In my case my working directory is epagi.

    cd C:\xampp\htdocs\epagi
  3. Type git init.

    git init
  4. Create some file.In My case I have created index.php
  5. Use git add to add the file.

    git add index.php
  6. Use git commit command,To commit added files.

    git commit -m "Added inedx.php"

Create new repository from an existing project.

In this case you have an existing project that you want to start tracking using git.

  1. Go to the working directory.

    cd C:\xampp\htdocs\epagi
  2. Type git init.

    git init
  3. Use git add to add all of the relevant files.

    git add ...
  4. Use git commit command,To commit added files.