Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Whenbot One Liner Contribution Guide

M7 edited this page May 29, 2012 · 4 revisions

One-Liner Contribution Guide

Follow these steps to make your one-liner contribution to Whenbot.

If you'd like a more detailed guide, see the Diaspora Git Workflow Guide (specifically, the "long version" section). We'll be following pretty much the same approach, but try and line things up with this guide too, as there may be some changes.

  1. Create a fork of the Whenbot App repository

    • Click the "Fork" button on that page. It's on the same line as the "Watch" button
    • It will ask you "where do you want to for this to?" Click the button that says "Fork to "
  2. Open the Terminal / console

  3. Find a folder you'd like to save your fork to

  4. Clone your personal fork by running the following

    $  git clone [email protected]:*username*/whenbot.git
    • Note: We're not going to worry about running bundle install and getting the gems installed. You can do so if you want. Holler if you have any problems.*
  5. cd into your newly downloaded repository

  6. Configure remotes:

    Note: When a repo is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repo it was forked from. To keep track of the original repo, you need to add another remote named upstream:

    $ cd whenbot
    $ git remote add upstream git://github.com/ottawaruby/whenbot.git
    

    More details on this here: http://help.github.com/fork-a-repo/

  7. If you haven't done so already, choose a One-Liner to work on from the list here. Follow the "How To Participate" section to learn how to reserve your One-Liner.

  8. Create a new branch for your one-liner

    $ git checkout -b 10-my-one-liner

    Where "10" is the number of your One-Liner. This command creates a new branch called 10-my-one-liner and then switches you to your new branch (via the checkout command).

  9. Open up the file that contains your one-liner

    • The filename is the first bolded path/to/filename when you scroll upwards from your One-Liner
  10. Implement the change,

  11. Commit your changes locally to your One-Liner branch:

    $ git add . $ git commit -m "a commit message explaining the change"

    Note: The git add . command will add any new files that you've created. You can type git status if you want to see which files are currently tracked/untracked by Git, and which files have been modified.

  12. Get the changes made to the remote repository

    $ git fetch upstream

    Note that this command doesn't make any changes to your current branch's files. Instead, it updates your local copy of the remote repository (the one you cloned above). You can then choose to merge the changes if you'd like.

  13. Switch to your local master branch, and update it with any changes that have been made on the remote repository:

    $ git checkout master $ git pull upstream master

    Running git checkout master switches your current branch the master branch (you were making your changes on your one-liner branch [e.g. 10-my-one-liner]). The git pull command is like running git fetch followed by git merge.

  14. Switch back to your one-liner branch, and Rebase it against master

    $ git checkout 10-my-one-liner $ git rebase master

    Why rebase? See this link: http://book.git-scm.com/4_rebasing.html

  15. Push your one-liner branch to your fork on GitHub. This will also create a new branch under your fork.

    $ git push origin 10-my-one-liner

  16. Come back to GitHub and go to your fork's home page.

  17. Switch your branch from master (which may be selected by default), to your branch (i.e. the branch you just pushed to. For example 10-my-one-liner).

  18. Click the Pull Request button to issue a pull request

  19. In the comment box, describe your change.

  20. Submit your Pull Request.

  21. Please, don't accept your own pull request, let someone else review it and accept it.

  22. If you see any outstanding pull requests in the Issues list, feel free to review their changes, and accept/merge their pull requests.

And that's it! Step by step, that wasn't so bad, was it? :)

Holler if you have any questions.