Workshop Instructions: Contributing to Open Source

Git Introduction

Install Git

You can download Git directly or, on Linux, install it via your package manager – or it might well already be there!

Do not use the GitHub client or the GitHub web UI!

Try Git

  • git init  # Create the repository
  • git add  # Get your stuff “staged”
  • git commit  # Get the stuff into the git repository
  • git reset –hard  # Get back to the current “git state”

Branching:

  • git status  # See what’s going on
  • git log  # See the latest commits
  • git checkout -b <branch_name>  # Creates a new branch
  • git commit -a  # Automatically adds all files that are already in git
  • git show  # Shows the last commit

Checklist

  • Git is installed.
  • You have a basic understanding of Git commands.

Enter the Community

  1. Accept your organization invitation. If you can’t find the mail, join at http://github.com/coala-analyzer/
    1. Hint: You can make your membership public if you want to.
  2. Join https://gitter.im/coala-analyzer/coala/workshops
  3. Pick an issue from http://tinyurl.com/coala-new

Checklist

  • You had a conversation at the Gitter channel.
  • You have entered the org.
  • You are assigned to an issue.

Coding

  1. Fork the repository of your issue. (Optionally star it 🙂 – you don’t want to watch it!)
  2. Clone your fork: git clone <fork_clone_url>
  3. Search related files. Useful command: git grep <something>
  4. Fix your issue!
  5. git commit –all
  6. git push
  7. Click “Create Pull Request” on GitHub

New git commands:

  • git clone
  • git push

Checklist

  • You have forked the repository and cloned your fork.
  • You have done a commit.
  • You have created a Pull Request.

Iterating

Somebody will review your pull request. Enjoy! 🙂

New git commands:

  • git commit –amend  # “Change” the old commit

Checklist

  • You got your commit merged.

We would love to get feedback at http://tinyurl.com/cos-workshop