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.
There will be some files that you don't want Git to track. You can use a.gitignore file to list the files and/or folders that Git should ignore.
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
# 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: