This guide outlines the process for contributing to the ongoing development of the STACK website. It is not necessarily complete and in some cases it may be useful to find additional tutorials.
If you are already confident with git and markdown then the technical details are given in the git README.md file.
This website is stored in the git version control system. To update the website you need to
You can review your proposed changed before you commit them, and a full history of all your commits will be available to everyone. (Drafts which you do not commit remain private to your machine.)
If you only need to make a minor update to a single page, e.g. adding confirmed dates to a listed event, then you can edit the files directly on github. This is the simplest way to contribute. All you need is a github account (step 1 below). Any proposed changes you commit will be reviewed by a colleague who has permissions to "push to the master branch", so you will not affect the live website immediately.
Git and version control processes are widely documented online. Feel free to search for guides if you'd like a better understanding of version control. Two recommended sources are Roger Dudler's git - the simple guide and GitHub's About Git page.
In order to update the website you will need the following:
This guide is based on using VSCode for code editing and GitHub management. However, other combinations of code editors and GitHub GUIs can be used in similar ways. To set up VSCode you can see this guide or follow the steps below.
The STACK website content is stored in, and built from, the GitHub repository maths/stack-web. Git is used to manage files, and the process for managing files with git is as follows (full details on these are provided below).
maths/stack-web to accept your changes by sending them a "pull request". The pull request is when you ask them to bring their version up to date with a particular commit from your fork of the repository. (Git will merge any changes, and colleagues with relevant permissions will be responsible for resolving any conflicts caused (rarely) when two people edit the same file!)This process appears complex! GitHub is a public space where you can store a repository and share it with others. You need an account on a public space when you ask someone else to accept your changes, i.e. when you later send them a "pull request".
(More experienced users, who have permission to write direct to the STACK project, might not use their own fork. They might push directly to the original repository. Git is "distributed", so advanced users can share code directly between git repositories without going via public sites like github.)
The practical process of creating a copy of a repository in your own github account is known as "forking" and is done as follows:
maths/stack-web repository.
. This will open the "Create a new fork" page.master branch only by checking the relevant box (you can choose to include branches by unchecking the box and all branches will be copied). Click "Create fork":
.A new repository your-github-username/stack-web will be created and you will be redirected to it. This is your own personal copy of the website files. You have permission to write to this copy and (normally) anyone can read it. This repository is stored online in your personal account.
The practical process of creating a copy of a repository in your own local computer is known as "cloning". It is recommended to sign in to Github in VSCode at this stage if you haven't yet done so.
To sign in to GitHub in VSCode follow these steps:
.git config --global user.email "your-email-address".git config --global user.name "your GitHub username".To clone the repository follow the steps below:
your-github-username/stack-web.
.https://github.com/your-github-username/stack-web.git, by clicking on the copy button next to it:
. A "Copied!" message will temporarily appear.File --> New window.
. A small window will appear at the top of the screen:
Modify the website files to make the updates required. Ensure you follow the guidelines outlined in the git README.md file. If you would like to preview your changes you will need to follow the instructions in the Testing the website locally section of the guidelines.
The process of getting the changes saved in your local computer into your online repository (on github) is composed of two stages:
A commit saves the state of one or more files in the git repository in an indentifiable way. It is good practice to commit a small number of changes, preferably on a single topic, at a time and provide a short description. This helps reviewers understand the purpose of your changes. You can push commits as you create them or all together at the end. Each commit will be outlined separately in GitHub.
When you save changes to a file or create a new file, a number will appear in the Source Control icon on the side bar:
. The number represents the number of files changed. Click on the Source Control icon to commit and push your changes as follows:
.
, and select "Push". This will update your GitHub repository with the changes you created.The process to update the website with your changes is done through a "Pull Request". A pull request asks colleagues (with the relevant permissions) to review your changes and "pull" your changes into the main repository. If they accept your request they will "Merge" your changes into the maths/stack-web repository. When changes are merged into the repository, GitHub automatically updates and re-builds the website to include the changes. Creating a pull request is done as follows:
your-github-username/stack-web repository.
.
. This will open the "Comparing changes" page and automatically draft the settings for the pull request, including all your pushed commits. The target (left hand side of the arrow) should be base repository: maths/stack-web and base:master. The source (the right hand side of the arrow) should be head repository: your-github-username/stack-web and compare: master. It should look similar to the following figure, with your username on the greyed-our area instead:
. This will finish the process and a colleague with relevant permissions will review your pull request and either get back to you or merge it.The following diagram summarises the steps to update the website:
maths/stack-web repository to create a copy of it in your own GitHub account.your-github-username/stack-web repository to get a copy in your local computer.If others update the website while you are working on your Fork, it is recommended to sync these changes into your repository. This process consists of the following steps (full details will be added to this guide soon):
maths/stack-web repository into your your-github-username/stack-web repository.Coming soon...