Some files should never be committed: build artifacts, secrets, OS junk. List them in .gitignore:
# .gitignore
node_modules/ # dependency folder
*.log # all .log files
.env # environment variables (secrets!)
dist/ # build output
.DS_Store # macOS metadata
*.pyc # Python bytecode
*.log — matches any file ending in .logbuild/ — matches a directory named build!important.log — exception: don't ignore this file**/*.test.js — matches in any subdirectorygit check-ignore -v secret.txt # find out why a file is ignored
git status --ignored # show ignored files too
Create a .gitignore that ignores *.log files and the tmp/ directory. Then commit .gitignore and app.txt — the log file and tmp dir should NOT appear in the commit.
Click "Run" to execute your code.