Create an account or otherwise login to GitHub
Install GitHub Desktop to your computer: https://desktop.github.com/download/
Go to the template repository for this workshop: https://github.com/fhdsl/reproducibility-sandbox
This repository is a “mock” analysis. It has an example folder and file organizational structure that looks like this:
When you look at the README for this repository however, you will notice it is blank.
Click the green
Use this template
button and then
Create a new repository
. If you don’t see this button, you
may need to expand your window.
On the next screen, create a
Repository name
.
Choose Public
.
Scroll to the bottom and click
Create repository
.
GitHub Desktop is a great tool to help use use version control and
interact with GitHub.
Open up GitHub Desktop on your computer.
Go to File
>
Clone Repository
.
Search for your ITN workshop repository name in
the tab that says Github.com
. Click on the name of this
repository in this list. You can choose where you’d like it to download
on your computer underneath Local Path
.
Click the blue Clone
button.
Note the three buttons on the main GitHub Desktop repository page that connect us to related apps.
We will be “juggling” some windows when doing this activity:
Code editor
– we’ll actually edit files with thisFiles
– we’ll find where our files are on our computer
with thisOnline GitHub
– we will send our pull request and
suggested changes to online GitHub.com with this.Pull requests are great for suggesting changes in a way that allow us
to preview and discuss the changes before merging to the
main
version.
We will practice filing a pull request by filling in the the README. READMEs are great for getting folks up to speed on a repository or code base.
But to create a pull request, we first need to create a branch to
work from that is separate from the main
copy.
Click the Current Branch
box
> New branch
.
Call this new branch
readme-edit
.
Click the Show in Finder
or
Show in Explorer
button depending on your operating
system.
With any text editor open up both the
01-heatmap.Rmd
file and the README.md
file
Copy all the text from
01-heatmap.Rmd
(Cmd + A - Mac, Ctrl + A - Windows).
Go to phind https://www.phind.com/search
Ask phind to create a README from the code. Copy
(Cmd + A - Mac, Ctrl + C - Windows) and paste (Cmd + V - Mac, Ctrl + V -
Windows) in the code from 01-heatmap.Rmd
. You may want to
do some variations on the prompt you use to ask phind to do this to get
good results.
Copy all the text from the desired Phind output
and paste it to README.md
. Save the file.
Go back to GitHub Desktop. You should see
1 changed file
in the upper right corner. It may be upper
left for Windows.
Type in a “commit” message. Commits are how we
add things to our branch.
Click the button that says
Commit to ...
it will have your branch name which should be
readme-edit
.
Click the Publish branch
button.
This will “push” your changes to online Github.com
Follow GitHub Desktop’s prompt to
Create a Pull Request
and click the blue button. If the
blue button says Preview Pull Request
then click the
downward facing arrow to see the option to
Create a Pull Request
.
It should open up a page on GitHub.com Fill out
the Add a title
and the Add a description
boxes to appropriately describe the work you did on the branch we are
making the pull request from.
Click Create pull request
.