Search code examples
gitatlassian-sourcetreegit-flowsapui5

git-flow on more that one master


I use git-flow on SouceTree to manage my project; all worked well until now, but now I want redefine the interface with the backend (in summary I will replace the ajax call to the server to functions call to new oData object...) Ok, my desire is to have two branches:

  1. "legacy" master and develop branches from which I can continue to to expand my project with the all ajax interface
  2. "new" master and develop branches from which I can do a massive operation to connect with new oData object and other consequent changes.

The first (bad)solution is to have a "new" release branch from the "legacy" develop.

Have you got any other solutions?

p.s.
The fork cold be the solution, but I can't fork my repository.. I haven't a GitHub account and I have a remote bare repository on a network disk. I have tried to clone the old_repo into fork_repo but when I try to push my local changes to remote fork_repo I have this message:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
Pushing to G:\Sorgenti\SorgentiGIT\intra_fork

remote: error: refusing to update checked out branch: refs/heads/master[K
remote: error: By default, updating the current branch in a non-bare repository[K
remote: error: is denied, because it will make the index and work tree inconsistent[K

remote: error: with what you pushed, and will require 'git reset --hard' to match[K
remote: error: the work tree to HEAD.[K
remote: error: [K
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to[K
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into[K
remote: error: its current branch; however, this is not recommended unless you[K
remote: error: arranged to update its work tree to match what you pushed in some[K
remote: error: other way.[K
remote: error: [K
remote: error: To squelch this message and still keep the default behaviour, set[K
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.[K

Solution

  • I don't think you understand well the signification of master branch.

    Master branch reflects a stable (running in production, or ready to go in production) version of your project. Develop is your main developing branch, where all you feature branches are merged once your features are done.

    Once you are ready to release a new version of you product, you merge your develop in master.

    What you want to do is maintaining two master, and two develop branches. That is non-sense. You can not have two master branches for one project. Either you want to maintain the two versions at the same time (and so, you are close to have two separated projects, so two masters, no problem), or you want to do all on the same project.

    If you want to "stay" on the same project, what you need is not a second pair of master/develop, but more or less a v2 branch, with v2/feature branches for all your features. Once you think your v2 is ready for production, merge it on develop, then in master when all your integration process is done.