File naming | Tracking changes with version control
File Naming
A file naming convention will
- Help you find your files
- Help others find your files
- Help track which version of a file is most current
Make it human-useable and -readable
- Simple enough that you’ll actually do it, and clear enough that it’s actually useful
- Define conventions for your directory structure, folder names, and file names.
- Include a text file (readme) describing your naming conventions.
- Use short, descriptive file names that are meaningful to you and your team.
Make it machine-readable
Easily find and sort files, and allow for bulk processing of files or groups of files organized into directories.
- Think about how you want your files to appear when your computer sorts them.
- Consider starting with the most general category and ending with the most specific, so that related files will sort together.
- Dates: yyyymmdd
- Versions: 01 instead of 1
- Keep file names short: some software will only accept file names up to 32 characters.
- Avoid special characters in your file names such as: “/ \ : * ? “ < > [ ] & $. These characters have specific meanings for various operating systems and could result in your files being deleted or misplaced.
- All lower case can help avoid confusion on teams using more than one operating system. Windows sometimes changes file names to lower case without your permission, which can lead to confusion for Mac and Linux users, where not only are case-sensitive, but sorting is often case-sensitive as well.
Suggestions for experiment files
Consider including information such as the following:
- Unique identifier (ie. Project Name or Grant # in folder name)
- Project or research data name
- Conditions (Lab instrument, Solvent, Temperature, etc.)
- Run of experiment (sequential)
- Date (in file properties too)
- Use application-specific codes in 3-letter file extension and lowercase: mov, tif, wrl
- When using sequential numbering, make sure to use leading zeros to allow for multi-digit versions. For example, a sequence of 1-10 should be numbered 01-10; a sequence of 1-100 should be numbered 001-010-100.
- No special characters: & , * % # ; * ( ) ! @$ ^ ~ ' { } [ ] ? < > -
- Use only one period and before the file extension (e.g. name_paper.doc
NOT name.paper.doc OR name_paper..doc)
example: Project_instrument_location_YYYYMMDD[hh][mm][ss][_extra].ext
Digital Humanities Image Files Example
File Naming Convention: nameofexhibit_year_titleofobject_number.jpg
File Naming Convention Defined:
- nameofexhibit_: A very short title representing the digital exhibit
- year_: The year the file was added to your collection of historical sources
- Titleofobject_: A very short title for the object, e.g., the title given to the object by the original source you got the object from
- Number: Three-digit number starting with 001 for every image. If more than one image with a similar filename exists, apply a numerically ordered sequence
File Naming Convention in Practice:
- outliers_2020_ sojournertruth_001.jpg
- outliers_2020_angeladavis_001.jpg
- outliers_2020_angeladavis_002.jpg
- outliers_2020_rosaparks_001.jpg
File renaming Applications: If you have many files already named, consider using a file renaming application such as ReNamer (Mac/Windows)
Tracking Changes with Version Control
Keep track of versions of files (version control):
Manually: Use a sequential numbered system: v01, v02
OR:
Use version control software such as Git which can track revisions to files and help you roll back to a previous version of a file.