Overview
Teaching: 30 min
Exercises: 15 minQuestions
How should we manipulate data?
Objectives
Define git vocabulary (commit, fork, pull request, repository, commit message).
Demonstrate ability to navigate through a Github repository main page.
Define the difference between a directory and a repository.
Create a repository on GitHub.
Demonstrate ability to commit changes to text files with a commit message.
Evaluate repository History.
Create a pull request to someone else’s repository.
Requirements
- Must have a Githuv account.
Overview
- In this activity you are going to learn how to collaborate using Github. With a partner you will learn some basics which allow you to share and edit files on Github.
- Create a git repository hosted at GitHub
- Build README.md file
- Commit changes to repository
- Collaborate by forking and editing partners file
- Explore Github features: graphs, diff, blame, ect.
### Create a repository with a README.md
file
Follow along with your instructor and perform these steps:
1. Go to your Github profile. The url should be http://github/your-user-name.
1. Create a new Github repository, click the green “new” button, under the repositories tab.
1. Name your repository work-organization-your-name
1. In the details write “tips to organizing research”.
1. Click the initiate a README.md file option.
README.md
, then click “edit this file”. Add the following information into the readme.md file:
tip: Notice that you can use markdown syntax. Use this guide for Github’s flavor of Markdown
. Use the “Preview” button to view the formatting of your README.md
file.
### Collaborate Now it is time to collaborate with your partner. Navigate to your partner’s repository by typing the url directly into your address bar. In order to edit someone else’s repository you usually follow this simplified work flow: 1. Fork their repository to your user account 1. Make edits and commit 1. Create a pull request that merges your changes into their repository.
tip: Depending on the project there are variations on the above work flow. Often the rules for contributing to a project are outlined in a file called CONTRIBUTING.md
within the repository. One of the more often used works flows is Github Flow.
work-organization-their-name
.Now that you have accepted the pull request. Take a few minutes to explore the git history using the Graphs section of the repository.
Find a way to practice by contributing more. You don’t have to be a great at programming to help with projects. Many projects are in need of spelling or general editing. There is a whole Twitter community that helps beginner Git users find projects to practice using git.
Check it out if you want to contribute to more projects: https://twitter.com/yourfirstpr.
If you are interested in practicing this process try adding a quote to this repository: https://github.com/TheCodingCollective/quotes.
Overview
RStudio and version controls - Git - Subversion
For this lesson we will focus on git
rr-version-control-demo
repository.rr-version-control-demo
GitHub repository.rr-version-control-demo
.Now you have a copy of rr-version-control-demo
repository in your account, woohoo!
How can I tell if I am looking at my fork or the original repository? - Look at the URL - Look at the name of the repo on the upper left corner, for your fork it will say:
[your-github-name]/rr-version-control-demo
forked from Reproducible-Science-Curriculum/rr-version-control-demo
knit
again. Examine the output for changes.gdp-life-expectancy.Rmd
and gdp-life-expectancy.html
by checking the boxes next to then, and hit Commit
.Don’t worry about the other files that appear in this pane, we’ll get to them in a bit.
.Rmd
file. You can view it for the HTML file as well if you like.push: When using git push always means pushing commits from your local respository (your computer) to a remote repository (Github).
- Now push your changes to GitHub by hitting Push
.
- Enter login information as needed.
Key Points
Keep raw data read only.
Manipulate data in a reproducible manner