How to Use .gitignore Files in Git to Ignore Files


show more Using .gitignore files provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training show less
please wait ...

Using .gitignore files

In the previous chapters we saw that git does a really good job of noticing new files as well as changes to existing files in our working directory. In fact, as soon as we added a new file to our working directory Git noticed and added it to the list of untracked files. So, for example, if I take this tempfile.txt and drop it into my project directory, I can say git status and right away git recognizes this is an untracked file. But what if this is in fact a temporary file that we don't care about or what if it's a log file that's constantly changing, git would constantly be prompting us to commit those changes to the repository. Instead, what we really want is a way to tell Git just ignore the files altogether, that's what we're going to learn how to do in this chapter.

To tell Git which files it ought to ignore, we're going to create a special file in the root of our project, in the root of the working directory. And that file is going to be called .gitignore, so it's a...

Using .gitignore files
Video duration: 8m 23s 6h 25m Beginner

Viewers:

Using .gitignore files provides you with in-depth training on Developer. Taught by Kevin Skoglund as part of the Git Essential Training

Subject:
Developer
Software:
Git GitHub
Author:
please wait ...