For most projects at LifeChurch, we run two main git branches: “integration” and “master.”
Master is what’s currently deployed. If there’s an emergency, changes go to Master and are deployed. This is very rare.
Integration is our current branch we’re all working on. When we’re ready to deploy, Integration gets merged into Master and deployed.
For development, however, we work on “topic” branches locally. If I’m working on a user story, I make a new branch for that story: “git checkout -b addRssFeeds integration” (create a new branch called “addRssFeeds”, based off integration, and switch to it)
At the end of the day, this can create a large number of branches I have to delete (once they’re submitted to integration after a code review, of course).
@kmorey helped me write this easy Bash script. It checks out integration, and deletes all branches that are not “integration” or “master”. It then does a remote update and rebases integration off origin/integration. Enjoy.
If you’ve got a better method, or see any changes I can make to this script, please let me know!!
Writer. Musician. Adventurer. Nerd.
Purveyor of GIFs and dad jokes.