Collaboration with Github and Git

About Us

  • Cassie Moy (@cassie_moy)
  • Libby Horacek (@horrorcheck)
  • Position Development (www.positiondev.com)

amc-workshop.github.io

The Plan

  • What is git?
  • What is Github?
  • Use Github to work together on an open-source website
    • suggest changes with issues
    • make changes with forks, branches, and pull requests
  • Next steps for learning more

 

About you

 

Goals for this workshop?

What is git?

What is git?

git : a tool for managing changes to files

What is git?

How do you save changes

to your work?

  • Can you undo changes?
  • Can you see what changes you've made over some time period?
  • Can you make lots of experimental changes without worrying about losing anything?

What is git?

"version control"

also known as 

DIY version control:

Make copies!

  • Save a new copy whenever you make a change
  • Label the copies with the date, maybe a description
  • Make folders for big changes

What is git?

Now how do you work with many people changing many things?

What is git?

git to the rescue!

  • Save a history of all the changes you've ever made
  • Look at files before and after changes
  • Group changes
  • Merge changes
  • Handle conflicting changes
  • distributed version control

What is git?

git is a powerful tool

...it's also very complex

What is git?

We're going to focus on using git through Github.com

What is Github?

Github is a service for projects that use git

What is Github?

it has a cute mascot ->

Github hosts

source code repositories

What is Github?

A repository ("repo" for short) is a collection of files used in a project

repo on your computer:

local repository

What is Github?

repo on Github:

remote repository

We're not going to get to this today

We'll focus on this instead

You can use many git tools through Github.

What is Github?

commits

logs

branches

Github also adds additional tools to make collaboration easier.

What is Github?

Issues

Forks

Pull

Requests

Downsides of Github

  • Does not have ALL the functionality of git

What is Github?

  • Github expects you to use the git command line tool to create new projects and merge changes.
  • git desktop applications have many more tools
  • Free as in $$$, but not open source

Our project:

A website about

this workshop!

amc-workshop.github.io

 

The repository

Github Pages

  • Creates a website from the files in a project
  • Doesn't cost anything!

Repository tour

Plain text files that get turned into web pages

Repository tour

Style sheets and layouts that make the pages pretty

Repository tour

Settings for the program that makes the web pages

  • Most software projects have a "README" file
  • If there is a file called "README" in a directory, Github will display it below the listed files

Repository tour

Repository tour

The most recent commit

a single commit

- deletions

+ additions

a single commit

Commit Log

Demonstration of using Github

Let's collaborate on this website!

Create or log in to

 your account on

github.com

Demo

Create an issue!

  • Is something on the website not very clear?
  • Could something have a better name?
  • Have an idea for making the site better?
  • Silly suggestions welcome!

Demo

Create an issue!

  • Click the "Issues" tab
  • Click "New issue"
  • Write a title and description.
  • Click "Submit new issue"

Demo

Let's add changes!

Demo

Fork the repository

Demo

  • Repository owners choose who can make changes to their repository
  • Most don't let you make direct changes
  • Instead, you can "fork" the repo
  • Creates a copy on your account that you can change however you want

Fork the repository

Demo

Fork the repository

Demo

Create your own page

Demo

  • Click the "_participants" folder
  • Click "Create new file"
  • Enter a name for the file that ends in ".md"

Create your own page

Demo

  • Write something about yourself, this workshop, AMC, or whatever you want!
  • Format the file like above (the dashes and "name: " are important!)
---
  name: Your Name here
---

# This is a huge heading

## A small heading

- A list
- of many
- items

[A link to a website](http://alliedmedia.org/)

Commit your new file

Demo

  • Enter a commit message -- a short description of the change you made (like "Add page for Your Name")
  • Enter a longer description (if you want)
  • Click "create new commit"!

Now what?

Demo

  • Now you have changes on a fork on your account
  • How do these changes get on the website?
  • The changes need to be pulled into the main repo and merged into the master branch.
  • Submit a "pull request"!

Submit a pull request

Demo

  • Click "New Pull Request".

Submit a pull request

Demo

  • Examine the changes you've made
  • If everything looks good, click "Create pull request"

Submit a pull request

Demo

  • Type a name for the pull request or use the one given.
  • Write an optional description.
  • Click "Create pull request".

After you submit

your pull request...

Demo

  • ask for more information
  • ask you to make changes
  • make their own changes
  • The maintainer may:

Merging pull requests

Demo

If a maintainer decides to merge the pull request:

 

Sometimes it can be merged by just clicking a button!

 

But if two people tried to change the same thing -- there will be a merge conflict and the maintainer will have to use the command line tool to fix it.

Wrapping up

Checkout the README for more learning resources!

Keep contributing

to the workshop repo!

Questions?

Feedback!

Thank you!

  • Georgia Reh for her Teaching Git article
  • Sumana Hareshiwara
  • Octavia Project for website example
  • Allied Media Conference
  • And everyone who participated today!

Collaboration with Github and Git

By emhoracek

Collaboration with Github and Git

  • 1,876