Pulling Upstream Changes

Now that everyone has contributed to the RSE-Sheffield repository (the upstream repository), the params/ folder contains a number of files, one for each successful pull request.

This is also clear form the commit locator

However your local copy of the repository only contains the template and your own file.

Q: How can I merge changes from the upstream repository to my local repository?

GitKraken Client makes it really simple.

Add the Upstream Remote repository

On the left side menu bar, hover over the REMOTE menu until a small button appears.

This should open the Add Remote Tab. Select the RSE-Sheffield/collaborative_github_exercise repository from the GitHub Repo dropdown menu and click the Add Remote button.

Once added, the RSE-Sheffield repository will be visible under the REMOTE menu

Pull upstream changes

To pull the upstream changes from the RSE-Sheffield repository, grab the RSE-Sheffield button from the history panel and drag it over to your local master branch until a icon appears next to it and drop.

Once you drop it onto the local master branch successfully, a pop up menu will appear. Select Fast-forward master to RSE-Sheffield/master. That ensures that you do not create a circular commit of your initial commit to the upstream repo when you are merging it back into your local repo. Find out more about fast-forward git merging.

Once the merge is complete, your local master will now be showing as synched with the RSE-Sheffield remote

and you will have copies of all the files contributed in your params/ folder! 🎉

Synch origin remote

The origin remote is your fork of the repository that’s labelled with your GitHub profile avatar. As you can see, it is now lagging behind the upstream remote and your local copy which are now both in sync. That’s because it’s still missing all the files contributed by the other participants.

To synch your origin remote, Push the changes you’ve just pulled into your local repository.

Once you’ve pushed, all the repositories should now be showing as synced. 🎉

Run the analysis

To run the analysis, open the project in Rstudio, click on the plot_trait_evolution.Rmd, then click on the Knit button. This should render including everybody’s species! See more on Rmarkdown notebooks