Ignore Files with .gitignore

Git Tips & Commands

Discover the ins and outs of creating a Git Ignore File and learn about the syntax for this file. Also, explore various coding courses and bootcamps that offer hands-on experience and real-world applications.

Key Insights

  • To create a Git Ignore File, save an empty file named .gitignore into the base folder of your Git repo using your code editor.
  • Files starting with a period (.) are hidden in Unix-based operating systems like macOS. To see these files, you need to show hidden files.
  • The .gitignore file is for listing any files you want to ignore.
  • The syntax for the .gitignore file can be learned from git-scm.com/docs/gitignore and atlassian.com/git/tutorials/saving-changes/gitignore.
  • High-quality coding courses and bootcamps are available for students of all experience levels.
  • Course options include Web Development, Python Programming, Data Science, and Web Design, all offered in NYC.

Git vs GitHub

Description
Git Local version control system — runs on your machine, tracks file history.
GitHub Cloud platform that hosts Git repositories — adds PRs, issues, collaboration.

Create a Git Ignore File

1. Using your code editor, save an empty file named .gitignore into the based (root) folder of your Git repo.

NOTE: On Unix-based operating systems such as macOS, files that start with a period (.) are hidden, so you will not see the .gitignore file in the macOS Finder unless you show hidden files. You should be able to see it in most code editors.

2. In this file you list any files you want to ignore. Here's an example of some files everyone would probably want to ignore:

# Mac.DS_Store.DocumentRevisions-V100.Spotlight-V100.Trashes

Full-Stack Web Development Certificate: Live & Hands-on, In NYC or Online, 0% Financing, 1-on-1 Mentoring, Free Retake, Job Prep. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

# Windows Thumbs.db

Syntax For.gitignore

To learn about the syntax for this file, refer to:

  • Git-scm.com/docs/gitignore
  • Atlassian.com/Git/tutorials/saving-changes/gitignore

Go Beyond Git

We offer the best coding courses and bootcamps for students at all levels of experience. Classes are hands-on and students receive workbooks with step-by-step instructions through exercises with real-world applications. Check out our programming courses now:

Learn more in these courses

How to Learn Git

Master Git with hands-on training. Git is a free, open-source version control system that allows developers to track the changes they make to code.

Yelp Facebook LinkedIn YouTube Twitter Instagram