Slides accompanying the tutorial can be found here.
- Make Github repo on Github.com
- Click "Clone or Download" on top right and copy link
- Open RStudio, click on "New project" —> "Version Control" —> "Git" —> paste the link you just copied
- Create a new R script called "test_script.R" and add the code
print("Yay Github!")
- Look at the “git” pane in the upper right of RStudio to see the staging status of the files
- In the bottom right "Files" pane, open the .gitignore and add
*.Rproj
to the file. What happens in the "git" pane? - Click “Commit” in "git" pane and check boxes of items you want to stage
- Type commit message
- PUSH!
- Verify that the files are updated in the Github repo online.
- Make Github repo (DO NOT INITIALIZE WITH README) and keep the page open. There will be text to copy under where it says "…or create a new repository on the command line." Highlight and copy it all.
- Go to existing R project.
- Go to the “Terminal” pane in the Console and paste the code from Github to add a README, initialize repo and push to Github
- Close and re-open the R project to see that the "git" panel has appeared!
- Add (stage) all files, commit them, and push.
- Verify that the files are uploaded in the Github repo online.
- Create an issue on Github by going to “Issues” tab and clicking “New Issue” green button
- Describe the issue with a title and a comment. Be informative, think about it as a “to do list”
- Create a branch in RStudio's "git" panel using the little flowchart icon next to where it says "Master." Call the branch "issue_(issue number)"
- Edit the scripts to make all changes related to the issue.
- Add, commit, push to that branch. For your commit message, have it start with "Closes issue #(issue number): " and then add more informative message.
- Switch branch to Master by clicking on the "issue_(issue number)" icon in the "git" pane
- Then go back to github and click ‘Compare and open a pull request”
- Pull request checks if there’s any merge conflict. If not: turns green, click “merge” to merge with master
- Delete branch
- Close issue!