Introduction to GitHub Alex Bigazzi Dec. 4, 2013 ITS Lab GitHub Introduction1
Functionality Version control Code sharing Collaboration 2GitHub 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 Introduction3
Architecture & Terminology Remote Repository (GitHub cloud) Local Repository Index (stage snapshot) Working Folder Add Commit Push Clone/ Pull/ Fetch Add Remote GitHub Introduction4 Local
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 Introduction5
Forking projects Main Branch Fork Merge My Branch r1 r2r3r4 r3 r6 r5 Test/add features in “My Branch” Then merge yourself, or send pull request (Revisions) GitHub Introduction6
Working online GitHub Introduction7 Examples: 1.Posting Portland ACE Android code 2.finding rCharts error 3.fixing rCharts
Integration with R “devtools” library Installing R packages – install_github(repo, username, branch,…) Running R scripts – source_url(" ") – Copy “raw” link from GitHub 8GitHub Introduction
Other Matters Online edits saved as commits Be sure to add descriptors to commit New repositories: 1.“readme” file 2.Choose public use license PSU rules about open-source code? GitHub Introduction9
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 Introduction10
Conclusion GitHub is useful for code sharing and collaboration Would an ITS Lab “Organization” be useful? What are the PSU rules about this? GitHub Introduction11
Resources the-hang-of-github/ the-hang-of-github/ 4. GitHub Introduction12