Git: Create Project

By Xah Lee. Date: . Last updated: .

To create a new project from scratch, do:

# cd to the dir containing your code
cd xx
# the directory can also be empty.

# initialize.
# This creates a .git dir in the current dir.
# This dir holds all git's data about the current project.
git init

# add all files of current dir (including subdir and files) to git staging area
git add .

# commit to local repository
git commit -m"my first commit"

The .git directory holds all git's internal data.