Skip to content
This repository was archived by the owner on Oct 14, 2025. It is now read-only.
This repository was archived by the owner on Oct 14, 2025. It is now read-only.

git flow refactor #327

@lifeiscontent

Description

@lifeiscontent

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions