gitflow
gitflow copied to clipboard
git flow refactor
Each change in git should be easy to introduce. If it’s not, you should refactor. When you are making your changes, you will be in a feature branch. Try to make your change without refactoring. If your meet resistance, make a “work in progress” commit, check out your base branch, and create a new refactoring branch:
git commit -m 'wip: new feature'
git checkout $base-branch
git checkout -b refactoring-for-new-feature
Refactor until you fix the resistance you met on your feature branch. Then, rebase your feature branch on top of your refactoring branch:
git commit -m 'refactor for new feature'
git rebase -i new-feature
git checkout new-feature
git merge refactoring-for-new-feature --ff-only
this flow
works well for me, and I think it'd be better if I could just do the following with git flow.
git commit -m 'wip: new feature'
git flow refactor start # switch to refactor branch
git commit -m 'refactor for new feature'
git flow refactor finish # switch to feature branch
What are your thoughts?
@nvie