Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6546823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:45:21+00:00 2026-05-25T11:45:21+00:00

We have several branches of one project that share about half of the code

  • 0

We have several branches of one project that share about half of the code and develop them simultaneously with git checkout. Now, the problem came when the model became so different, that it is no longer possible to keep the same database for their development. I could have specified the database name in the config/databases.yml specifically for each branch, but it is not tracked. Another solution would be to track some external file with branch name, for example, config/branch.txt, and reference it in config/databases.yml:

all:
  doctrine:
    class: sfDoctrineDatabase
    param:
      dsn: 'pgsql:host=localhost;dbname=<?php echo file_get_contents (realpath(__DIR__ . '/branch.txt')) ?>'

Anyway, how do you tackle this?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:45:21+00:00Added an answer on May 25, 2026 at 11:45 am

    What is usually done for managing the same file with different content amongst branch (without having to deal with merge issue) is to:

    • use a merge driver (like keepmine) in order to always keep the local version of the file during a merge

    • or use a filter driver with:

      • a config/databases.yml.tpl versioned
      • a way to get back the right value depending on the environment (like the name of the current branch)
      • a ‘smudge‘ script (versioned) which will combine, on checkout, the template and the right values in order to produce a complete config/databases.yml

    smudge/clean

    The script and the template file are always the same from branch to branch (no merge issue).
    The resulting config/databases.yml remains a private one, not versioned.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several Git repositories that all have one branch called 'master.' But what
I have several Git repositories that all have one branch called 'master.' But what
I have a coworker that checked in several branches into origin. He cleaned them
I have several branches of a git project, with the differences primarily being in
I have two branches with several commits each. On one branch, I can go
Suppose I have a git repository with several branches. I suspect some of the
I have a 'master' branch and several topic branches. Assume that the master branch
I have several databases that each have a table called, say, products . One
I use git to interface with an SVN repository. I have several git branches
Sometimes I'm working with several branches at once. Say I have branches called master,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.