mkdesign82's avatar

create feature branch in git

Hello, guys, I'm new to git but I've learned most of the commands. I have started a new project and I have sold about 15 copy of this web project. now let's guess one my customer calls me and say, hey can you make me a feature for my project and in response I say yes why not so I began to start a new branch of the master branch and made that feature then I'll merge that branch with the master branch. every thing is good and okay until the same customer calls me and say hey can you make me a new feature, in response, i say yeah, so I began to start a new branch of a master branch. the problem is that when I made a new branch of master branch all of the codes from the first feature will clone in the second feature which I do not necessarily need that coz maybe one of my other customers call me and say I need the second feature, but as I describe above that feature maintain the first feature codes. so any one knows how to handle this kind of problems? or maybe I should make any feature as a package.

thanks for any help

0 likes
2 replies
luis02lopez's avatar

Hey, you could maintain a Master branch with all the features, and have individual branchs for each costumer you have.

RayC's avatar

You could fork your main repo for the customer requesting specific features. You would not have to merge it with the master branch or repo but can if the need arises. At that point you would create a new pull request with the new features/changes to the master repo.

With the fork you can set an upstream connection to keep the fork up to date with changes to the main repo master branch.

Here is some good reading on using forks and such with Git: https://stackoverflow.com/questions/3329943/git-branch-fork-fetch-merge-rebase-and-clone-what-are-the-differences

Please or to participate in this conversation.