170 likes | 400 Views
Introduction to GitHub. Alex Bigazzi Dec. 4, 2013 ITS Lab. Functionality. Version control Code sharing Collaboration. Potential Benefits. Track revisions Collaborating on projects Exploring open-source code jQuery, rCharts , devtools , etc. Modifying others’ code Scripts
E N D
Introduction to GitHub Alex Bigazzi Dec. 4, 2013 ITS Lab GitHub Introduction
Functionality Version control Code sharing Collaboration GitHub Introduction
Potential Benefits • Track revisions • Collaborating on projects • Exploring open-source code • jQuery, rCharts, devtools, etc. • Modifying others’ code • Scripts • R packages • Install in R using rtools GitHub Introduction
Architecture & Terminology Remote Repository (GitHub cloud) Remote Push Local Repository Clone/Pull/ Fetch Commit Local Index (stage snapshot) Add Add Add Add Working Folder GitHub Introduction
Posting Content • Create GitHub account online • Free for open code • Working on a local machine • Install Git Bash (command line) • $ git clone… [or] $ git pull… • [move files to working directory] • $ git add… • $ git commit… • $ git push… GitHub Introduction
Forking projects Main Branch r2 r3 r4 r5 r1 r6 Fork Merge r3 (Revisions) My Branch Test/add features in “My Branch” Then merge yourself, or send pull request GitHub Introduction
Working online Examples: Posting Portland ACE Android code finding rCharts error fixing rCharts GitHub Introduction
Integration with R • “devtools” library • Installing R packages • install_github(repo, username, branch,…) • Running R scripts • source_url("https://raw.github.com/username/repo...") • Copy “raw” link from GitHub GitHub Introduction
Other Matters • Online edits saved as commits • Be sure to add descriptors to commit • New repositories: • “readme” file • Choose public use license • PSU rules about open-source code? GitHub Introduction
Organizations • Home for a group’s code • Organization owns repositories • Free for Open Source • Dashboard • Repositories • Members’ GitHub accounts • Can fork to the Organization GitHub Introduction
Conclusion GitHub is useful for code sharing and collaboration Would an ITS Lab “Organization” be useful? What are the PSU rules about this? GitHub Introduction
Resources http://gitref.org http://rogerdudler.github.io/git-guide/ http://net.tutsplus.com/tutorials/other/getting-the-hang-of-github/ https://help.github.com/articles/set-up-git GitHub Introduction