Detailed guidance for users of Git based code repositories

  • Updated

There are several repositories available for the storage and sharing of code, but the most widely used are Git based systems, particularly GitHub.

Git based code repository support

To support researchers in using Git based systems for storage and sharing, we have put together a set of resources specifically for you.  These resources provide guidance, short scripts and links to external (non-accredited) tutorials which can support you in using Git based repositories in a safe and appropriate manner.  They will help you share your code easily, minimise the risks of data breach and ultimately safeguard the UK Biobank data.

  • If you are new to using Git, there are several tutorials available to help guide you through its basic use. 
  • If you have completed a Git training course or have experience using Git but are not sure if the tutorials are for you, we have a list of some core Git concepts that we’d recommend you be familiar with before proceeding with starting your own Git project using UK Biobank data:
    • Can you set up a .gitignore file and add files, folders, file types, and filename patterns to it?
    • Do you know the difference between staging, committing and publishing?
    • Can you undo, revert or delete a staged, committed, or published file?
    • Are you familiar with each of these git commands?
  • Using the repository

When you have decided which repository to use, there are some key things to think about when setting up your repository:

-Be clear who has access to the code

-Set a clear structure for your repository

-Make sure you clearly separate code from your data files, or any files containing information such as passwords, login details etc.

-Use tools such as Gitignore / githooks

These tools provide an additional level of security, in that you can specify which items you do not want to commit to the repository.  Eg specifying participant identifiers, which will then be highlighted / removed when the tool is run.

 

Please see below some beginner-level guides to getting started with GitHub or deepen your skills. Please note, these are not in any way accredited or developed by UK Biobank but are all freely available

Beginner-Friendly Guides

Video Tutorials

Official GitHub Resources

  • GitHub Docs Learning Resources: Includes articles on GitHub flow, repository tools, Issues, Discussions, and links to Git basics and the Pro Git book.

Online Courses

 

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.