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 containing node_modules as a "section" (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_3This 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.