

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 6
click for more info
Not enough gems
Cost: 6 gems
1: Gitignore
incomplete
2: Nested Gitignore
incomplete
3: Patterns
incomplete
4: What to Ignore
incomplete
This lesson's interactive features are locked, please to keep using them
As you've seen, it's pretty normal to use the following workflow from the top level of your repo:
git add .git commit -m "some message here"git push origin mainA problem arises when we want to put files in our project's directory, but we don't want to track them with Git. A .gitignore file solves this. For example, if you work with Python, you probably want to ignore automatically generated files like .pyc and __pycache__. If you are building a server, you probably want to ignore .env files that might hold private keys. If you (I'm sorry) work with JavaScript, you might want to ignore the node_modules directory.
Here's example contents of a .gitignore file, which exists at the root of a repo:
node_modules
.env
This will ignore every path matching node_modules as a path segment (directory name or file name). It ignores:
node_modules/code.jssrc/node_modules/code.jssrc/node_modulesIt does not ignore:
src/node_modules_2/code.jsenv/node_modules_3src/node_modules.jsThis will also ignore the .env file preventing you from committing sensitive environment variables (like API keys, DB credentials, etc.) ...cause that would be bad.
root: 12345
admin: 54321
lane: 00000
prime: APICJJY$$PO!NJ@L
# Guilty Pleasures (tell no one)
- The Notebook
- The Love Guru
- Birdemic: Shock and Terror
- Troll 2
- Manos: The Hands of Fate
- Sharknado
touch .gitignore
A .gitignore is just a plain text file named ".gitignore". Edit it like any .txt or .md file.
Run and submit the CLI tests from the root of your project directory.