Figure 1: Interface of the GitHub repository of the training material
Click on CONTRIBUTORS.yaml file
View the file
You should see something like:
Figure 2: CONTRIBUTOR file
This CONTRIBUTORS.yaml file is where we collect the information (name, email, etc) about the different contributors to display them on our Hall of Fame. You will add your information there. But first you need to sign in to GitHub to be able to change this file.
Hands-on: Sign in to GitHub
Create a GitHub account (if you do not have one already)
Sign in (once you have a GitHub account)
Edit a file
You can now modify the CONTRIBUTORS.yaml file to add your information there
Hands-on: Edit a file
Open the CONTRIBUTORS.yaml file on GitHub
Click on hands_on icon (top right of the file)
A new page will open:
Figure 3: CONTRIBUTOR file in edit mode
Modify the CONTRIBUTORS.yaml by adding yourself
You should use your GitHub username and add it followed by : (the : is important) at the correct position given the alphabetical order.
Scroll down to the bottom of the file
Fill the Propose file change form
It can also be named Commit changes for the ones with write accesses to the repository
Fill the box “Update CONTRIBUTORS.yaml” with “Add < GitHub username > as contributor” (replace < GitHub username > by your GitHub username)
Comment: Commit messages
This a commit message: a description explaining why a particular change was made. Theses messages capture the history of the changes, so other contributors can understand what have been done and why
Leave “Add an optional extended description…” empty
Click on Propose file change
Without realizing it, GitHub let you create your first branch (named here patch-1) and add a changement on this branch.
Comment: Branching
Branching is the way to work on different versions of a repository at one time. By default your repository has one branch named main which is considered to be the definitive branch. When you create a branch off the main branch, you’re making a copy, or snapshot, of main as it was at that point in time.
By changing a file in this branch, it will diverge from the main branch. It will contain data that is only on this new branch.
Open a Pull Request
Then the addition of your information in the CONTRIBUTORS.yaml file is currently only on your branch patch-1. Not on the main branch and so not only on the Hall of Fame. You can’t add or push directly to the main branch, so you need to create what we call a pull request.
The GitHub interface guides you through this process: after clicking on Propose file change, a new page opens:
This message is a good way to introduce yourself and to explain the message you made. Be kind and descriptive. It helps the reviewers to understand why you did your changes and if it should be intergrated into the main branch (and then website).
Comment: Pull request messages
GitHub uses Markdown, a simple Markup language, to render the Pull request messages. You can then add bold test, lists, images, etc.
Scroll down and check the changes you made
In green with +: what you added
In red with -: what you deleted
Click on Create pull request
You have created your first pull request!
Your pull request will be reviewed. There are two possible outcomes:
Your pull request is accepted. Congratulations! Your changes will be merged into the main branch of the original repository. The website will be re-built and you will be in the Hall of Fame
Your pull request needs modifications: the reviewers will ask for some changes, possibly because the automatic tests are failing.
Update a Pull Request
One of the reviewers of your pull request asked you to add your name after your GitHub username in the CONTRIBUTORS.yaml file.
Hands-on: Update a Pull Request
Go to the list of pull request tab on GitHub
Click on your pull request
You can see here the comments the reviewers left you
Click on Files changed tab and see the changes you made
Click on hands_on icon
Add your name below your GitHub username
It should look like:
bebatut:
name: Bérénice Batut
Navigate to the bottom of the file
Fill the Commit changes form, similarly to the Propose file change form before
Make sure the Commit directly to the patch-1 branch is selected
Click on Commit changes
The pull request should be automatically updated
Check that the new changes are added to the pull request on GitHub
Close the Pull Request
Great! You now know how to make pull request on GitHub, and how to make changes after a review.
Reviewers can now approve and merge your pull request.
Because this was just a practice pull request, let’s close it again.
Hands-on: Close the Pull Request
Once you have run through all these steps, please close the pull request again.
Whenever you add your first real contribution, you can add yourself to the CONTRIBUTORS.yaml file in that PR.
Conclusion
With this tutorial, you learn how to use GitHub to change a file, create a pull request and then contribute to the training material. What you have learned here can be applied to any file.
Via the GitHub interface, you can also go further: create file, branch directly, etc.
To learn that, we recommend you to read the GitHub guide
Key points
You can’t add or push directly to the main branch, so you need to create a pull request
1 pull request = 1 branch
The pull request is the foundation of the collaborative development of the training material
Did you use this material as an instructor? Feel free to give us feedback on how it went.
Did you use this material as a learner or student? Click the form below to leave feedback.
Batut et al., 2018 Community-Driven Data Analysis Training for Biology Cell Systems 10.1016/j.cels.2018.05.012
@misc{contributing-github-interface-contribution,
author = "Bérénice Batut",
title = "Contributing with GitHub via its interface (Galaxy Training Materials)",
year = "2022",
month = "10",
day = "18"
url = "\url{https://training.galaxyproject.org/training-material/topics/contributing/tutorials/github-interface-contribution/tutorial.html}",
note = "[Online; accessed TODAY]"
}
@article{Batut_2018,
doi = {10.1016/j.cels.2018.05.012},
url = {https://doi.org/10.1016%2Fj.cels.2018.05.012},
year = 2018,
month = {jun},
publisher = {Elsevier {BV}},
volume = {6},
number = {6},
pages = {752--758.e1},
author = {B{\'{e}}r{\'{e}}nice Batut and Saskia Hiltemann and Andrea Bagnacani and Dannon Baker and Vivek Bhardwaj and Clemens Blank and Anthony Bretaudeau and Loraine Brillet-Gu{\'{e}}guen and Martin {\v{C}}ech and John Chilton and Dave Clements and Olivia Doppelt-Azeroual and Anika Erxleben and Mallory Ann Freeberg and Simon Gladman and Youri Hoogstrate and Hans-Rudolf Hotz and Torsten Houwaart and Pratik Jagtap and Delphine Larivi{\`{e}}re and Gildas Le Corguill{\'{e}} and Thomas Manke and Fabien Mareuil and Fidel Ram{\'{\i}}rez and Devon Ryan and Florian Christoph Sigloch and Nicola Soranzo and Joachim Wolff and Pavankumar Videm and Markus Wolfien and Aisanjiang Wubuli and Dilmurat Yusuf and James Taylor and Rolf Backofen and Anton Nekrutenko and Björn Grüning},
title = {Community-Driven Data Analysis Training for Biology},
journal = {Cell Systems}
}
Congratulations on successfully completing this tutorial!
Developing GTN training material
This tutorial is part of a series to develop GTN training material, feel free to also look at: