Git: Create Project
To create a new project from scratch, do:
cd projectDir
→ go into your project dirgit init
→ initialize the dir to be a git repo.git add .
→ add all files in the dir to git.git commit -m"first commit"
→ commit to the (local) git database.
here's a sample with more explanation:
# 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.