This page explains how to pull a specific branch from the NetAssessApp repository. The repository has a branch named for each netassess team member. The idea is that we each work on our own component and keep our code up to date on our own respective branch of the repository. That way others can see what you are doing, and in the future we will be able to merge the branches.

This document assumes that you are using RStudio, which makes it very easy to create R projects and Git repositories.

1 Create Local Repsitory

I’ll demonstrate the process by creating my own local Git repository and pulling the NateByers branch from the NetAssessApp repository. To pull your branch just replace NateByers with your GitHub username.

First, I create a local Git repository by going to the file where I want the repository to be located and right click. Select “Git Bash” and this will open up a shell.

Select “Git Bash” Git Shell
git bash git shell

In the shell I type

git clone https://github.com/LADCO/NetAssessApp.git -b NateByers --single-branch

You should see a “NetAssessApp” folder in the directory in which you right clicked “Git Bash”.

2 Create an R Project

Then I create a new R project called NetAssessApp by clicking File -> New Project

create project

I select Existing Directory and specify the file directory of the NetAssessApp folder under “Project working directory:”.

Exisiting Directory Working Directory
existing directory working directory

3 Push New Commit

Once you’ve created the project you’ll see the files in the NetAssessApp repository in the lower right panel of RStudio. In the top right hand panel, under the Git tab you can also see there are no changes to the repository since you just cloned it from GitHub.

files

To demonstrate how to make commits and push them to your branch of the repository on GitHub, I save a text file to the NetAssessApp folder. It shows up in the top right panel of RStudio under the Git tab.

hello

In the top right panel I click the box next to the test.txt file and click the “Commit” button. A new Git gui opens in RStudio. I add a note in the top right panel under “Commit message” (this is not optional–just add a short note describing what you’ve changed in the repository) and click the “Commit” button.

Select Test Document Add Message
commit message

After closing the confirmation window, the Git gui is clear, meaning there are no more changes to commit. To push the change I just committed I click the green up arrow in the top right corner. I enter my GitHub username then password, and I close the push confirmation window.

Green Push Arrow Username and Password
push password

We can see on the GitHub site for the repository that the test.txt file is on the NateByers branch but not the master branch.

NateByers Branch Master Branch
nate branch master branch