On Tue, 20 Aug 2013 07:43:09 -0700 (PDT)
Smiley <lyley...@gmail.com> wrote:

> I have a repository on a server which is running along nicely. It
> houses a php project for reference.
> When I set up a local version I need to be able to keep certain files 
> separate.
> My first thought is that I have a config file. In which is the root
> domain that the app is running from.
> On my live server this is something like dev.smiley.com but it needs
> to be localhost/dev on my local machine.
> How would I go about configuring this?

The usual solution is to not keep configuration files in the repository
at all but rather keep there their templates (like, say,
config.php.template instead of config.php).
Then at each deployment point -- your testing server being one of them
and your workplace being another -- copy the templates to real
configuration files and edit appropriately.

You could possibly make this soultion a bit less tedious if your
configuration files could be split into "common" (and less frequently
changing) parts and site-specific parts -- you could then keep such
common files in the repository and do something like
in them, keeping *no* site-local.php in the repository but rather
maintaining it as an untracked file at each site.

Another possible approach is to use the so-called smudge/clean filters
which re-write specific files upon checkout and commit but these are,
IMO, are far more complicated to setup and maintain and appear to be an
overengeneered solution to the problem as simple as yours.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to