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.
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 |
---|---|
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”.
Then I create a new R project called NetAssessApp by clicking File -> New Project
I select Existing Directory and specify the file directory of the NetAssessApp folder under “Project working directory:”.
Exisiting Directory | Working Directory |
---|---|
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.
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.
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 |
---|---|