170 likes | 321 Views
GitHub 102 Tutorial. Fork this Repo!. Tutorial Session - Web Experience Toolkit CodeFest 2014 August 14 & 15 2014 Justin Longo – PostDoc in Open Governance Center for Policy Informatics, Arizona State University slides etc. available at http://jlphd.wordpress.com
E N D
GitHub 102 Tutorial Fork this Repo! Tutorial Session - Web Experience Toolkit CodeFest 2014 August 14 & 15 2014 Justin Longo – PostDoc in Open Governance Center for Policy Informatics, Arizona State University slides etc. available at http://jlphd.wordpress.com Twitter: #GitHub102 @whitehallpolicy
Learning Objectives • Copy a repo to your account • Contribute to other repos • Flag an issue • Issue a pull request • Manage a pull request • Create your GitHub webpage
Fork a Repo • To fork a project, just go to the repo you’re interested in, and click the “Fork” button. • For example, go to https://github.com/wet-boew/wet-boew and click “Fork”
Fork a Repo And a few seconds later, and the repo is now magically in your account: This is a full copy that you can edit as you want without affecting the original.
Fork a Repo You can see how many forks a popular repo has:
Flag an Issue Go to test site: http://bit.ly/githubcinderella. Click on the Issues Icon: On the next page, click on the green “New Issue” button.
Flag an Issue To complete the issue flag, you would describe the issue (title, message), assign someone responsible, add a label and then click on “Submit new issue”. The owner will review the issue and respond.
Flag an Issue Issues can get very detailed. Here’s the start of a very fun issue comment thread with over 700 comments) related to the October 2013 U.S. government shutdown (you can find it at http://bit.ly/govshutdowngithub).
Pull Requests: Making a Simple Contribution To propose a change to someone else’s file, navigate to the page you want to change and click on the pen icon You will see this notice: By editing directly through the GitHub.com interface, you are quickly borrowing a copy of the master. This is a simple way of proposing a change. No need to “Fork the Repo” to propose a simple change.
Pull Requests: Making a Simple Contribution Enter any changes you want to propose: When you’re done, scroll to the bottom of the page, label your change and describe it, and then click on “Propose file change”
Pull Requests: Making a Simple Contribution On the next page you'll see this: Your title and description are brought over from the previous page. Click on “Send pull request”. The owner of the file will receive your suggested changes.
Managing Pull Requests • If someone else sends you a pull request, you’ll receive a notification. • Navigate to the open issue and review what was proposed. • Once you’re satisfied with the pull request – and if it can be automatically merged – click the "Merge pull request" button, enter a commit message and click "Confirm merge”. • This button merges the pull request into the original, sends a notification to the person who initiated the pull request, and closes the pull request.
Create your GitHub Webpage • First, you need to create a special repo in your account dedicated to only the Pages files. • On your profile page, in the top-right corner, select the + icon and click on “New repository” to get to this page: • choose a “Repository name”. You must use the username/username.github.io naming scheme • write a short description (“My GitHub webpage” works) • mark the repo as “Public” • mark the check-box “Initialize this repository with a README” • “.gitignore” = None • <-- Licence = CC0 1.0 Universal (Creative Commons). • <-- Click on “Create Repository”.
Create your GitHub Webpage • Go to the main page for this dedicated repo you just created, and then click on “Settings” in the right-hand column. • Scroll down to “GitHub Pages” and click on the magical “Automatic Page Generator” button. • You’ll see a page like this: • <-- Edit the page name and tagline • <-- Edit the page body • <-- Click on “Continue to layouts”.
Create your GitHub Webpage • Pick your favorite layout and click on the green “Publish page” box to publish your page. • You’ll find your awesome page at http://yourusername.github.io • (It may take up to ten minutes to show up.) • Edit the file index.html to pretty-up the home page.
Exercises for Later • Fork some more repos • Contribute to other repos • Flag an issue • Issue a pull request • Manage a pull request • Edit your GitHub webpage • Check out “Jekyll and Github Pages” with Shawn Thompson – Friday at 2 pm http://wet-boew.github.io/codefest/sessions-en.html#shawnt-session-title • Continue to explore GitHub
Tutorial Notes • Slides, project posts, my contact info:http://jlphd.wordpress.com • Government GitHub User Survey: http://bit.ly/githubsurvey • Online Tutorial: http://nextpolicychallenge.github.io/tutorial.html • GitHub Glossary (GitHub version): https://github.com/NextPolicyChallenge/NextPolicyChallenge.github.io/blob/master/glossary.md