git smudge/clean filter between branches

I expected to see the value true in the file

You just created a new branch, not checked out its content (sice its content is the same as the branch you were in)

To force the smudge to run, do at the top of the repo:

git checkout HEAD --

I have not yet merged the change across from the test branch, I have not made a commit on the production branch, yet the file has changed.

That is the idea of a content filter driver: it modifies the content, without affecting git status (which still reports the modified file as “unchanged”).

To have a smudge acting differently per branch, I would recommend calling a script which starts by looking the name of the current branch.
See an example in my older answer “Best practice – Git + Build automation – Keeping configs separate“.

#!/bin/sh
branch=$(git rev-parse --symbolic --abbrev-ref HEAD)

Leave a Comment