Metadata
Title
Public Code Repository Best Practices
Category
general
UUID
ab667cd92e1b4fe4971a26680d3bdf1f
Source URL
https://ospo.library.jhu.edu/learn-grow/public-code-repository-best-practices/
Parent URL
https://ospo.library.jhu.edu/
Crawl Time
2026-03-10T04:35:31+00:00
Rendered Raw Markdown

Public Code Repository Best Practices

Source: https://ospo.library.jhu.edu/learn-grow/public-code-repository-best-practices/ Parent: https://ospo.library.jhu.edu/

In this section

Learn & Grow

The Johns Hopkins OSPO recommends a set of best practices for researchers maintaining publicly available code repositories in our GitHub Enterprise instance or other version control systems. For research software code repositories, we recommend adding a license, README, Contributing file, Version, and Identifiers such as DOIs, SWHIDs, and/or Citations. Repositories that aren’t research software but which are publicly available can still benefit from adding a license, README, and a version.

Below you’ll find information about each recommended best practice, and you can always contact the OSPO at ospo@jhu.edu if you have questions or need assistance implementing these recommendations.

code

Licensing

The rights to use, inspect, distribute, and modify open-source code are granted by the open-source license, an intellectual property license, and legal agreement. If your code is stored in a publicly-available repository on GitHub, GitLab, Bitbucket, or elsewhere, you should add a license to it. It’s a common misconception that code without a license is free for others to use. In fact, the opposite is true! Copyright law in the United States grants you copyright protection for your code as soon as you create it. Without a license, others may not legally use your code without permission.

The OSPO has a video Explainer about open source licensing and a comprehensive Licensing guide developed in collaboration with JHTV that provides information about types of OS licenses, choosing the right license for your project, and the differences among licenses, copyright, patents, and trademarks.


description

README

A README serves as the introduction to your software and provides users with important information on how to get started. Add a README to your repository to help others understand the purpose of your code, why it was created, what it does, and how it works; provide clear instructions on installation, usage, and dependencies; and encourage collaboration by providing clear guidelines for potential contributors. The OSPO has a video Explainer that provides a quick introduction to writing READMEs, and a GitHub template to copy for your own repository. The website Markdown Guide is a great resource for getting started with Markdown, a useful formatting language for GitHub.


share

Contributing

A well written CONTRIBUTING.md should help guide would-be contributors through everything they need to participate confidently and successfully with your project. At minimum, it should welcome contributors, explain the development environment, tools, and package managers needed to build and test the project, describe the workflow (branching strategy, how to run tests, how to submit patches/pull requests), and point to related resources such as the issue tracker or code of conduct. The OSPO has a video Explainer that provides a quick introduction to writing Co,ntributing.md files and a GitHub template to copy for your own repository.


change_history

Versioning

Software versioning is the structured assignment of unique identifiers to distinct states of software so that changes, whether new features, bug fixes, performance improvements, or architectural revisions, can be clearly tracked, referenced, and managed across the lifecycle of a project. Beyond supporting deployments and rollbacks, versioning enhances reproducibility in research by enabling others to retrieve the exact code state used in experiments or analyses, which is critical for verification and reuse in academic work.


search

Findability

The FAIR principles—Findable, Accessible, Interoperable, and Reusable—provide a framework for making research outputs more discoverable and useful to the broader scientific community. Originally developed for research data, these principles have been adapted for research software to address the unique challenges of preserving and citing code.

For our GitHub Campus users with public repositories, we recommend adding a citation and persistent identifiers to your repository. Citation can be easily created using the web tool CFFINIT. For persistent identifiers, we recommend Digital Object Identifiers (DOIs), which provide a permanent link to specific releases of your software and are widely recognized in academic publishing, and/or Software Hash Identifiers (SWHIDs), which create an intrinsic, permanent reference to your code as preserved in the Software Heritage archive. DOIs can be minted by depositing your code into the Hopkins Research Data Repository or into Zenodo. A SWHID can be created by syncing your repository with the Software Heritage archive. We also recommend adding the ORCiD identifiers of everyone who contributed to the software to the Citation and repository. 

The OSPO has Explainers for DOIs and Citations if you need more information!