Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Go Ahead, Break My Day

In Mifos source control head/master (the "master" branch of the "head" repository) is the "bleeding edge" of development. Ideally, this branch will always be stable But accidents happen, so here's what to do when you break the build.

...

No Format
# Create new WIP branch off master:
git checkout -b hudsonBuild-someWIP --track origin/master

# Make experimental changes, commit them.

# Push upstream:
git push origin hudsonBuild-someWIP

# Hudson sees the branch appear and automatically builds the code.

# If others have meanwhile done other work on master, you'll first have to:
git checkout hudsonBuild-someWIP
git pull --rebase

# If you like the changes and want them on master, do this:
git checkout master
git merge --ff-only hudsonBuild-someWIP
git push origin master

# Whether you keep the changes or not, prune the branch from the remote server (note the colon):
git push origin :hudsonBuild-someWIP

# Switch back to master and delete the WIP branch:
git checkout master
git branch -d hudsonBuild-someWIP

# Or if for whatever reason you like to keep WIP branch around locally for a moment, then instead:
git checkout master
git branch -m hudsonBuild-someWIP _DONE_hudsonBuild-someWIP

See Also