0

I'm facing an issue regarding git branch. I have a branch called F-branch where I want to develop new code and new features. And Later on, this is to be merged into the master branch. After merging to master, I got to realize that I just need the feature 1,3 and 4 rest of them are not required. And I need a minimum of rollbacks.
What would be the strategy should I adapt to fix this? One strategy would be not to merge all the features until all the features are developed. And after that, we cherry pick the features and merge them into the master. I've attached a photo that explains everything.
I really appreciate your input.

  • 4
    That photo explains nothing – Mad Physicist Jun 28 '18 at 08:06
  • 2
    One strategy is to branch out per feature. I'd say that my comment explains everything but I'd wait for more info from you. – Andy Refuerzo Jun 28 '18 at 08:11
  • The branch in the image contains dots which represents the commits. And I suppose each commit represents a feature. After a few weeks, If I need that I just need the feature(go back to commit) 1, 3, 4. What would be the strategy? One way would be to develop all the features and then pick which one to merge with the master.
    Another solution would be to rollback to that specific commit(That would be a really bad idea). I hope I convey the problem. @AndyRefuerzo
    – Ali Hassan Jun 28 '18 at 08:57
  • @Ali Hassan This sounds like a misunderstanding on git principles. Give a shot at the documentation about branching. What you describe as commits in your attached image has nothing to do with branching strategy. – Romain Valeri Jun 28 '18 at 09:04

1 Answers1

0

After merging to master, I got to realize that I just need the feature 1,3 and 4 rest of them are not required. And I need a minimum of rollbacks.

Your problem has nothing to do with git. You have a broken project management process.

A functional PM process should asure that you only develope features, that are really reuqsted by your clients (and payed for). Some agile methods like Scrum or Kanban have worked out sucessfully for quite a lot of enterprizes.


But git may offer a work around: You can "revert" commits like this:

 git checkout master
 git revert [shh1 sha2 ...]

Git will create new commits and apply the opposit changes.

Timothy Truckle
  • 15,071
  • 2
  • 27
  • 51