The very first step for any new project should be to create a Git repository to hold your source code so that you can track changes from the outset. Unlike centralized version control systems such as SVN, Git allows you to easily create and add to the new repository without needing a centralized server to hold it.
This recipe will show you how to create a new Git repository that is ready for content to be added.
For this recipe, you will need either a Red Hat- or Debian-based Linux host with a Git client installed.
To create a new Git repository, follow these steps:
Create a new directory to contain your project in:
mkdir ~/projects/newproject
Use the
git init
command to initialize the new project:git init ~/projects/newproject
The git init
command creates a directory called .git
within the directory of your project. This directory contains all the the data required for Git to track content. Any changes made to the configuration for this repository will be contained within this directory.
You can find more details on how the git init
command works at: