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.

Ignoring files

Ignoring files - Git Tutorial

From the course: Git for System Administration

Start my 1-month free trial

Ignoring files

- [Instructor] There may be times when you want to store files in the Git project directory, but you don't want Git to track them. If we copy the files into the Git Project Directory, Git won't automatically track them, but it will warn you every time you do a commit that there are untracked files. What we really want is for Git to ignore the files completely. If we've decided not to store binary files in our Git project, we may want to ignore those. To do so, we'll create a dot Git ignore file on our project root. Make sure you're in your Git Project One directory and then create a file called dot gitignore. I'll be using Vim for this. In this file, we just add patterns for files that we want to ignore. For instance, if we want to ignore any files ending in dot exe, we'd add asterisk dot exe. Archive files might be ones we want to ignore as well. I'm going to type in asterisk dot zip as well as asterisk dot tar dot gz. Some editors, like Vim, create dot swp files when we add a text…

Contents