I'm trying to use Git's smudge/clean filters to create a file that can differ based on environment.
In my repo, I have the following files:
/root/scripts/data.config.local
/root/scripts/data.config.staging
/root/scripts/data.config.production
When a checkout occurs on the developer machine, I want the data.config.local file to be copied to the /root/scripts directory as "data.config".
My global .gitconfig has the following filter definition:
[filter "copyEnv"]
clean = "rm -f c:\\code4x\\git\\rgpstage\\scripts\\gg_data.config"
smudge = "cp c:\\code4x\\git\\rgpstage\\scripts\\gg_data.config.local c:\\code4x\\git\\rgpstage\\scripts\\gg_data.config"
I've tried a number of variations on these filters, including moving the scripts to separate script files. My separate script file for smudge looks like this:
#! /usr/bin/bash
cp "C:\Code4X\GIT\rgpstage\scripts\gg_data.config.local" "C:\Code4X\GIT\rgpstage\scripts\gg_data.config"
I get the following output regardless of which approach I use for my filter action (either inline or file):
error: cannot feed the input to external filter c:\removeGGData
error: external filter c:\removeGGData failed
cp: cannot stat `C:\\Code4X\\GIT\\rgpstage\\scripts\\gg_data.config.local': No such file or directory
error: cannot feed the input to external filter c:\copyGGData
error: external filter c:\copyGGData failed 1
error: external filter c:\copyGGData failed
I'm running this on Windows 7, using Git 1.8. The file does exist and is opened in terms of permissions.