Git needs to be initialized in the root of each development project so that it can keep a track of all of the project files. Let's do this for our newly created verge
project!
1. Open Terminal.
2. Type the following command to change directories to our working directory:
cd /Library/Webserver/Documents/verge/
3. Type the following command to initialize our Git directory:
git init
4. Git will respond with the following:
Initialized empty Git repository in /Library/WebServer/Documents/verge/.git/
5. Keep your Terminal window open so that you can interact with Git in this chapter.
We used Terminal to initialize our Git repository by using the command git init
in our working directory. Git responded to let us know that everything went okay. Now that we have our Git repository set up, we'll need to add each file under source control when new ones are created. The syntax for adding a file to Git is simple, git add path_to_file
...