From the course: Git for System Administration

Creating a local repository - Git Tutorial

From the course: Git for System Administration

Start my 1-month free trial

Creating a local repository

- [Instructor] Now that we have Git installed and configured let's create our first Git project. What this means is that all files in this directory will be under Git revision control and those files could be tracked by Git. Since I'm doing this on Linux I'm going to create a directory in my user's home directory called GitProjectOne. Type in mkdir ~/GitProjectOne, and I'm doing it in camel case. Now cd into the directory. You can place yours in whichever directory you want, and you can name it whatever you want. The name itself doesn't matter, but it may be easier to follow along if the name is like mine. Now we're going to initialize the repository. Type in git init and hit Enter. We get a message saying that the Git project has been initialized, and it mentions a .git directory. This is the directory that Git uses to track our changes. This one directory makes this a Git project. If we delete it, then our directory will no longer be tracked by Git. Let's cd into .git. Type in cd .git and hit Enter. And then type in ls. The only item in here that we might work with manually is the config file. Inside the config file are project-level Git configuration settings. We talked about this in a previous video. If you want to set any Git configuration options at the project level you can do it in the config file. The other directories are used for Git's own internal processes of tracking and branching project files so we'll leave them alone.

Contents