Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Establish a simple workflow for managing pull pull requests
# Fork a repository (owned by someone else usually. In this case, fordprefect forked from rgsingh)
git clone
# Establish an upstream so that your fork can keep in sync with the original repo.
cd feature-dev-demo
git remote add upstream
# Pull down all of the deltas from the original repo via upstream
git fetch upstream
# Merge all of the changes that were pulled down with our forked changes.
git merge upstream/master
# Checkout and create a new branch for development on a GitHub Issue
git checkout -b i1-add-readme-helloworld
# Check to confirm which branch is active
git branch
# Make all changes specific to this feature (i.e. Fixes #1: Improve README friendliness factor)
$EDITOR myfile.html
# Use a tool like gitk or a simple text editor, but try to follow a consistent commit message format.
# For example, commit 9725e145bfc6a4b64a616f1ba98d49c2f3848b65 follows the format of
# "Fixes #<number>:" in a line of 50 characters or less followed by a blank line, followed
# by a brief description of the change and reason for making it, followed by a bulleted list of changes
# in the present tense (e.g. Specify instead of Specified in the commit shown). Note "Fixes" in the commit message
# will automatically close the ticket after the pull request is merged:
git commit -a
git log
commit 9725e145bfc6a4b64a616f1ba98d49c2f3848b65
Author: Ford Prefect <>
Date: Sat Mar 1 20:52:13 2014 -0500
Fixes #1: Improve README friendliness factor.
Many users were complaining that they were almost brought to tears when
they came across the format and content of the file. Adding
a friendly greeting will leave users feeling loved and welcome.
* Specify Hello World text within file.
commit 49759995f780af70ad14f254d6b9c2f18c08e73d
Author: rgsingh <>
Date: Sat Mar 1 06:16:26 2014 -0800
Initial commit
# Push all of your changes to your remote feature branch (i.e. this saves all of your
# local repository changes up on the remote forked GitHub repository)
# The '-u' option will make an association between the feature branch in the origin repo and your local feature branch
git push -u origin i1-add-readme-helloworld
# Within GitHub, a collaborator can create a Pull Request, for the original repo's master
# branch from the forked repo's feature branch (e.g. i1-add-readme-helloworld in this case)
# Send the pull request, wait for it to be merged (accepted) or rejected by the assigned
# pull request administrator (the user you assigned the pull request to). Use the following
# format : "Fixes #1: Improve README friendliness factor."
# The user that merges the pull request should send a message back to the pull request
# creator to close the issue (Issue #1 in this case).
# The feature branch (i1-add-readme-helloworld) can also be deleted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment