nvie / gitflow

Git extensions to provide high-level repository operations for Vincent Driessen's branching model.
http://nvie.com/posts/a-successful-git-branching-model/
Other
26.62k stars 2.66k forks source link

git flow refactor #327

Open lifeiscontent opened 11 years ago

lifeiscontent commented 11 years ago

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?

lifeiscontent commented 4 years ago

@nvie