Contribute with Forks on Github

Note: This tutorial is incomplete. It will updated by Friday, July 16th.

Video recording for this session




Table of contents



Introduction

Last week we looked at better ways of contributing to a repository on GitHub when you are a collaborator. This may not always be the case. Often times, development of open source software is brought about by contributions from active users who are not official collaborators on a project.

Take any popular R package on GitHub and look at how many people contributed code towards continuing development of that project. Chances are that many of them are not official collaborators. This week, we will learn how to contribute on github in such circumstances using forks.









































































1. Forking vs Cloning







2. Contributing as a non-collaborator


2.1 penguin creates a new repo


2.2 penguin creates a R package

cd ~/Github && mkdir mkhist && cd mkhist

git init

touch README.md
library(tidyverse)

mkhist <- function(x){
    print(x %>% head())
    x %>% gather() %>% head()

    ggplot(gather(x), aes(value)) +
        geom_histogram(bins=20) + 
        facet_wrap(~key, scales='free_x')
}


2.3 penguin pushes the package to github


2.4 puffin installs the package


2.5 puffin forks the package repository


2.6 puffin sets up repo for contribution

2.7 puffin adds more functionality to the package


2.8 puffin pushes updates to the fork


2.9 puffin creates a pull request


2.10 penguin examines and resolves the pull request