From the course: Git for System Administration

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Committing and adding files

Committing and adding files - Git Tutorial

From the course: Git for System Administration

Start my 1-month free trial

Committing and adding files

- [Instructor] Now that we have a Git Repository we need to make it do something. We can either create a new file, or copy one into the directory. Let's start by creating a new file. Make sure you are in your GitPrrojectOne directory. To create a file, I'll use a text editor. In my case, I'm on Linux and I'll use Vim. However, you can any editor you wish, including a GUI editor. It does not really matter. If you're using Vim, type in vim, space, ourfirstfile.txt. And hit Enter. I'll go into insert mode by pressing the I key, and then I'm going to type in, "This is our first file." To save and exit, I'll press Escape, colon, X, exclamation mark and hit Enter. So far, nothing has changed in my Git project because I haven't told Git to track this file. Let's check the Git status. Type in git space status, and hit Enter. It knows there's a new file and warns us that it isn't being tracked for a commit. We can do this by using the git add command. I can specify the file directly or I can…

Contents