Git - Initializing a Repository

From EdWiki

Initializing a Repository

  • Initializing a Repository in an existing Directory
    If you are starting to track an existing project in Git, you need to go to that project's directory and type
git init

This command creates a new subdirectory named .git that contains necessary repository files.
If you want to start version controlling existing files:

git add *.c
git add README
git add .

Adds files in the current directory recersively

git commit -m "Initial project version"

At this point, you have a Git repository with tracked files and an initial commit.