New to GitHub or this organisation? Welcome!
This GitHub organisation is for analysts in the Scottish Government and its agencies to code and collaborate in the open.
Analysts in Scottish Government and departments should use this GitHub organisation. This keeps everything in one place and makes it simpler to manage membership.
- Read the guidance below
- Create a GitHub account with your work email address
- Some people use their GitHub accounts for things that aren’t part of their job, such as personal projects or freelance work. If this applies to you, add a personal email address and then make sure you author commits with the appropriate email address, depending on the project you’re working on.
- Enable two-factor authentication
- Add a (work appropriate) photo and username
- Add your contact details and employer
- Request to join the Scottish Government Analysis organisation.
- Set your membership to public
- Create a repo and set ScotGovAnalysis as the owner. Make sure it’s relevant to other analysts within Scotland’s public sector. A relevant example might be: source code for an R Shiny app that accompanies an official statistic. A non-relevant example might be: code for a personal learning project.
- Add topics to your repo to help keep them organised. Your topics can include things about what area your repo is used for (e.g. exports) or what organisation it is for.
- Tell people about your repo
There are many benefits to coding in the open and the UK government has published guidance on how to do it securely. Governments across the world are coding in the open and Scotland’s public sector is no exception (see Public Health Scotland, Marine Scotland, and the Improvement Service).
Public services are built with public money. So unless there’s a good reason not to, the code they’re based should be made available for people to reuse and build on. UK Government - Digital Service Standard (12. Make new source code open)
Writing code is much easier if you don’t do it alone. Your goal should not be to strive in solitude for years before releasing the perfect package. Instead, work in the open, publishing not only the final product but every intermediate stage. If you work this way, you’ll get feedback much earlier in the process, and your motivation will remain high because you know people care. Hadley Wickham - Impact the world by being useful
You are responsible for anything you share online. Before sharing anything on GitHub, reflect on your ethical, legal and professional obligations. Things to consider:
- Certain legislation may apply to your work such as the GDPR and the Data Protection Act 2018
- You may be bound by the Code of Practice for Statistics (in particular T6: Data governance)
- GitHub stores a full history of your files and this GitHub organisation is a public space
- Your organisation may have an internal policy that covers coding in the open (e.g. an IT code of conduct)
- It might be appropriate to do a risk assessment
- Check with your line manager if you’re unsure of anything
Don’t share anything you shouldn’t share. Store these separately from your code (e.g. as environment variables):
- Usernames
- Passwords
- API keys
- Secrets
- Tokens
- Absolute filepaths
Use a .gitignore to reduce the risk of accidentally pushing files. A template .gitignore is included in this Welcome repository. If you accidentally publish a secret; assume it is compromised, revoke and refresh the secret. Do this no matter how quickly the secret was removed.
These practices might be a little overwhelming if you’re new to coding in the open. It’s not vital to adopt everything from the beginning and some practices may not be appropriate for a given project. These are suggestions to learn over time. The easier ones are near the top:
- Write good READMEs
- Add a lifecycle badge to your README
- Use GitHub Issues and Projects for code project management.
- Write good commit messages
- Raise good pull requests
If you’re new to Git/GitHub it’s worth reflecting on how you learn best. A mix of structured study and practice works for many people. Teaching others can also be an effective way to learn.
- Coding in the open
- Anna Shipman (previous Open Source Lead at GDS) compiled these resources for coding in the open
- The National Archives advise that code created by civil servants is subject to Crown copyright. The default licence for that is the Open Government Licence.
- Networks
- The govdatascience slack has a # chat-git channel
- Git and GitHub
- Jenny Bryan (Software engineer at RStudio) authored Git and GitHub with R
- A number of SAS products have Git integration
- GitHub has a community forum, guides and this article on how to set up Git
- RStudio has an article on version control with RStudio
- Pro Git covers using Git on the command line
This repository is available under the Open Government Licence v3.0.