What to not add to Git
Overview
Teaching: 5 min
Exercises: 0 minQuestions
What should be included in Git repositories?
Objectives
Consider the dos and don’ts of Git usage
What to not add to Git
A final note on what should and shouldn’t be included in Git repositories.
In general, Git can describe individual line changes for any sort of file that may be opened within a text editor. This includes many forms of code, documentation, HTML, simple data files, etc., but excludes other binary formats like:
- Microsoft Office documents and other rich text documents
- PDF files
- JPEG/PNG images
- Zip files
- Proprietary data files
- Etc..
Git may still store these files, but any version history would be less meaningful, without clear ‘diffs’.
More importantly though, Git repositories should not be used to store:
- Personal information, especially usernames, passwords, keys, secrets
- Details that are specific to an individual computer or system (e.g. use relative paths rather than full system paths)
- Large volumes of data / input files (make use of services like the DAP for these)
- Compiled executables, software libraries, and other files that may be regenerated by scripts when needed
Remember to make use of .gitignore
files to ignore and exclude files
as necessary.
Key Points
Git tags may be generated to note a particular version in history.
Consider use of git early in scientific workflows, for robust documentation
Open scientific work is more useful and more highly cited than closed.