Skip to content

GitHub SI Contributions

michael-coleman edited this page Dec 5, 2014 · 1 revision

Table of Contents

Submit pull request to Simple Invoices using git

If you have an existing github account and wish to submit a pull request to the Simple Invoices project, you can do so with the following steps:

Create your own fork

Go to the project home https://github.com/simpleinvoices/simpleinvoices and click on the fork button to create your own fork

For an tutorial on the "Forking Workflow" see here:

https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow

Clone the fork locally

Use the following command: (In order to load in Zend git submodule --recursive flag is required)

git clone --recursive [email protected]:your_github_account/simpleinvoices.git
Note: You may want to have 2 versions of your forked repo on your local machine.
  1. "Pristine" version, as per the command above.
  2. Working version - where you can have a running instance of the application and for generally playing around with - knowing you wont mess up your "pristine" fork

Add your changes to your local "pristine" repo

Use your preferred git workflow for adding commits to your repo, otherwise:

1. add your "working" remote repository to your "pristine" like this:

$ git remote add working file:///path/to/your/repo
then do:
$ git fetch working
and then you can cherry-pick any commits from your "working" remote.
$ git cherry-pick <commit-id>

(Optional) Merge down the primary code base

If you know changes have been made to the primary code base, or if a pull request has been denied because you are out of sync with the primary code repository, you'll need to do a merge.

First create a "remote" to the primary (aka upstream) code repository. You only need to do this once ever. You're basically defining an alias that can be reused across checkouts:

$ git remote add upstream [email protected]:simpleinvoices/simpleinvoices.git
Retrieve and merge updates:

$ git fetch upstream
$ git merge upstream/master

Push your changes

% git push origin my_descriptive_branch_name
If you cloned from another source than your fork, you can create a remote to your fork, and push to that fork instead of origin.

Submit a pull request

Go to your fork on the web site (e.g. http://github.com/YOUR_USERNAME/simpleinvoices), and click on the "Pull Request" button on the top. Under the base branch you should see simpleinvoices/simpleinvoices @ master and under the head branch username/simpleinvoices @ master. Replace "master" in the head branch with the name of your new branch (e.g. my_descriptive_branch_name). Press enter, and click the "Update Commit Range" at the bottom.

You should then be able to add a descriptive comment about what is in this merge, and submit the pull request. A project admin can then apply the merge to the primary code repository.

You can read more about pull requests here: http://help.github.com/pull-requests/