Rich Dougherty rd.nz

Play Framework Git workflow

Fork and clone the repo

  1. Visit https://github.com/playframework/Play20/fork_select to fork the repo.

  2. Clone your fork.

    git clone git@github.com:richdougherty/Play20.git mydir
    cd mydir
    
  3. Track upstream in your fork.

    git remote add upstream https://github.com/playframework/Play20.git
    # http://stackoverflow.com/questions/520650/how-do-you-make-an-existing-git-branch-track-a-remote-branch
    git branch --set-upstream master upstream/master
    

Starting work on a feature branch

git checkout master
git pull
git checkout -b mybranch

Folding commits and rebasing a feature branch

git commit -a
git log # review changes
git rebase -i HEAD~2 # for 2 commits
git checkout master
git pull
git checkout mybranch
git rebase master

Pushing a feature branch

git commit -a
git push origin mybranch

Folding commits and re-pushing feature branch

git commit -a
git log # review changes
git rebase -i HEAD~2 # for 2 commits
git push origin +mybranch

Linking a feature branch to an existing issue

# http://opensoul.org/blog/archives/2012/11/09/convert-a-github-issue-into-a-pull-request/
hub pull-request -i 999 -b playframework/Play20:master -h richdougherty/Play20:mybranch