My Git Workflow; Introducing Flit
I’ve been a Git convert, and version control geek, for over a year now so I’ve sort of become the unofficial Git consultant at the office. If anythings breaks or something weird happens I’m usually the one called in to sort it out.
In order to preserve at least some of the remnants of our sanity I decided, after my colleague managed to corrupt his entire local repository, that I needed to enforce some sort of system. What I finished up with is this fairly typical workflow:
- Find a feature (or bugfix, ticket, etc.) to work on
git checkout -b my_new_feature- Hack away at some code
git commitearly and often. Small diffs are the key.- When I’ve finished
git checkout master git pullany changesgit checkout my_new_featuregit rebase master- Fix any merge conflicts that I may have. If there are conflicts, fix them and keep going. Merge conflicts should be kept off the master branch if at all possible.
git rebase -iso that I squash all the commits in my branch down into one. This keeps the master branch nice and tidy.git checkout masteronce the code is readygit merge my_new_featuregit push