1

In Git-flow, you first create a master(stable) branch & develop branch and branch out feature branches from the develop branch to create feature/foobar_feature.

However, sometimes I later find that my feature branch already created became something very far from its original feature name.

  • Case 1: I created a project with my team and named a feature branch according to the name we came up with but later decided that there is a better name for that. For example in game development context, feature/item_foo_sword to feature/item_bar_sword.

  • Case 2: I created a feature branch expecting to accomplish some feature but on the way, turned out to be something basically different from what the name describes. For example in the context of developing a web video scraper, feature/header_scraper to feature/video_url_and_everything_scraper.

I know it's the best to just create a new feature if what I'm doing isn't what I named it but sometimes I just end up getting sidetracked and finish it on the wrong branch.

What is the best convention to modify my feature branch's name and make it less confusing abiding by Git-flow and other standardized rules? (if there's any)

user8491363
  • 2,924
  • 5
  • 19
  • 28

1 Answers1

1

You could simply:

  • create a new branch on top of the existing one
  • push it
  • delete your old name branch
  • push that branch deletion
  • notify your coworkers they need to fetch that new branch

The git-flow commands should then work with the new name.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250