Is there a way to keep two branches from merging in git

I would like to be able to keep two separate branches in a git repo that cannot accidentally be merged even though the branches may contain similar content.

Is there a trick for forcing a branch to remain separate in git? That is assuming I have branch A and branch B, something like git merge B //assuming A is checked out would fail.

The concern here arose because in creating a repository of a website I'm developing I need the HEAD of the master branch to always be the current state of the stable website.

Any development commits I need to occur on the development branch with topic branches off of the development branch if necessary.

 C1-C2                        master
     \
     C3-C4-C5-C6-C9-C10-C11   development
               \
                C7-C8-C12     topic/HEAD

I need to make sure that there's little chance of an accidental merge between the master branch and other branches.

So I'm looking for a way to step 'in between' a merge with the master branch to ask, "This merge will go live on the site, are you sure you want to do it?" And only after I confirm the merge will it go through.

I guess this scenario is relevant only to web developers with code that does not need to be compiled in order to run, and may pull copies of the stable website on a live installation.

6
задан dkinzer 2 November 2010 в 16:04
поделиться