This is a quick howto so I don't forget how to squash commits and push code up to github when it's release-time.
Remotes are setup like this:
github git@github.com:skalio/teambeamjs.git (fetch)
github git@github.com:skalio/teambeamjs.git (push)
origin git@git.skalio.net:teambeamjs.git (fetch)
origin git@git.skalio.net:teambeamjs.git (push)
The following remote branches exist:
origin/master
: Where development is donegithub/master
: Releases to the public
Additionally, local (feature) branches may exist.
While fixing stuff and and adding new functionality, work in local branch
master
, tracking origin/master
. Commit often, referencing trac tickets in
the commit messages, and push to origin/master
.
Once all work for a release is done, perform these steps:
README.md
: update documentation as necessary; update revision history at the bottom; commitpackage.json
: update version number; commit "Lifting version to v0.x.y"- not sure about this:
tag the commit:git tag -a v0.x.y -m "version 0.x.y"
- push everything up to
origin
:git push origin master v0.x.y
without the tag I think
The github releases don't need to show the individual WiP commit history, so we squash them:
- Go to detached HEAD state at tag of previous release:
git checkout v0.x.x
- Create a local release branch:
git checkout -b release
- Make sure we are up to date on github at HEAD of master branch:
git fetch github master
- Merge origin master to onto this position, making sure, origin master is favoured:
git merge --squash -X theirs origin/master
- Combine all changes into a single commit:
git commit -a -m "Lifting version to v0.y.y" -m ""
- Confirm that the result is no different from master:
git diff origin master
shall show nothing - Tag the commit:
git tag -a v0.y.y -m "version 0.y.y"
- Push everything up, but make sure it ends up in github's master branch:
git push --force github release:master v0.y.y
Github should now show a single new commit as well as a new release.
- switch back to master:
git checkout master
- delete the release branch again:
git branch -D release