-
Notifications
You must be signed in to change notification settings - Fork 54
Whenbot 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.
-
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 "
-
Open the Terminal / console
-
Find a folder you'd like to save your fork to
-
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.*
- Note: We're not going to worry about running
-
cd
into your newly downloaded repository -
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 namedupstream
:$ cd whenbot $ git remote add upstream git://github.com/ottawaruby/whenbot.git
More details on this here: http://help.github.com/fork-a-repo/
-
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.
-
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 thecheckout
command). -
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
-
Implement the change,
- If you want to see a solution, check the One-Liner Solutions branch here.
-
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 typegit status
if you want to see which files are currently tracked/untracked by Git, and which files have been modified. -
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.
-
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 themaster
branch (you were making your changes on your one-liner branch [e.g.10-my-one-liner
]). Thegit pull
command is like runninggit fetch
followed bygit merge
. -
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
-
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
-
Come back to GitHub and go to your fork's home page.
-
Switch your branch from
master
(which may be selected by default), to your branch (i.e. the branch you just pushed to. For example10-my-one-liner
). -
Click the Pull Request button to issue a pull request
-
In the comment box, describe your change.
-
Submit your Pull Request.
-
Please, don't accept your own pull request, let someone else review it and accept it.
-
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.