How do I use Git-based code repositories safely with UK Biobank data?

  • Updated

Git-based code repositories, such as GitHub, allow researchers to store, manage and share code.

When working with UK Biobank data, it's important to use these repositories responsibly to prevent the accidental sharing of sensitive data or confidential information.

This guide explains the key skills you need, how to set up a repository safely and where to find further training.

1. Before you get started

Before using Git with UK Biobank data, make sure you understand the following:

  • Using .gitignore: Can you exclude specific files, folders and file types from being tracked?
  • Managing changes: Do you understand the difference between staging, committing and publishing?
  • Removing files: Do you know how to undo changes or remove files that have been staged, committed or published?
  • Using Git commands: Are you familiar with the basic commands needed to manage your repository?

If you're new to Git, explore the beginner guides and tutorials listed below before creating your repository.

2. Setting up your repository safely

When creating or managing a Git-based repository:

  • Manage access: Check who can view, edit and contribute to your repository.
  • Organise your files: Use a clear folder structure to make your code easier to manage.
  • Separate code from data: Keep UK Biobank data and sensitive information, including passwords and login credentials, out of your repository.
  • Use safeguards: Tools such as .gitignore and Git hooks can help prevent files from being committed accidentally.
  • Important: These tools provide additional safeguards but do not guarantee that sensitive information cannot be shared. Always check your files before committing or publishing changes.

3. Training and further guidance

The following resources can help you develop your Git and GitHub skills.

Beginner guides

Video tutorials

Official GitHub documentation

Online courses

Please note: External training resources are not developed or accredited by UK Biobank.

Related guidance

 

Related to

Was this article helpful?

2 out of 2 found this helpful

Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.