Programming projects are required to include a .gitignore file in the
root directory of the repository unless an assignment specifically states otherwise.
The purpose of the file is simple: keep files that belong to the project under version
control, and keep generated, local, temporary, or private files out of the repository.
A clean repository should contain the files needed to understand, build, test, and maintain the project—not files created by your operating system, editor, IDE, compiler, runtime, or local development environment.
Keep your .gitignore minimal, project-specific, and understandable.
Do not copy a large generic template containing entries you do not understand.
Ignore files and directories that are created locally and do not belong in the shared project history. Common examples include:
Do not ignore files that are part of the actual project or are required by the course. These normally include:
README.md;.github/ and
.classroom50.yaml.
If you cannot explain why an entry is in your .gitignore, it probably should not be there.
.gitignore in the root directory of the repository.
# to organize or explain groups of entries
when the file contains more than a few patterns.
.gitignore as a substitute for understanding what belongs
in the repository.
The following is an example only. Your project may need fewer entries, different entries, or additional entries depending on the language and tools being used.
# Build output
build/
*.o
# Python cache
__pycache__/
*.pyc
# Local environment
.env
.venv/
# Editor / OS files
.idea/
.DS_Store
.gitignore applies to files Git is not already tracking.
Adding an already committed file to .gitignore does not remove it from
repository history.
.gitignore is not a security system. It can help prevent accidental
commits of local secret files, but a password, API key, or other secret that has
already been committed must be treated as exposed.
For additional details on .gitignore syntax and patterns, see:
Atlassian Git Tutorial: .gitignore
.