
Or using git directly: $ git config -local /Users/hsoi/Documents/BNR/Development/Projects/Fred/code/scripts/git-filter-smudge-project-identifier.sh Smudge = /Users/hsoi/Documents/BNR/Development/Projects/Fred/code/scripts/git-filter-smudge-project-identifier.shĬlean = /Users/hsoi/Documents/BNR/Development/Projects/Fred/code/scripts/git-filter-clean-project-identifier.sh Using a text editor, edit the $(PROJECTDIR)/.git/config file to add the smudge and clean filters: Scripts/git-filter-clean-project-identifier.sh sed -e 's/-bnr/-thing/' Scripts/git-filter-smudge-project-identifier.sh sed -e 's/-thing/-bnr/' I would create a script for each in a scripts/ folder committed to the repository: Let’s say I had to change an identifier from -thing to -bnr. Furthermore, if multiple developers accessing the codebase all need to apply the filter, it should be easy for everyone to adopt without error. While it’s permitted to define the filter inline, that’s useful for only the simplest of filters. That is one downside: it’s totally quiet, so failures aren’t readily surfaced. In my case, the build-to-deployment environment didn’t want these changes, just us developers, so we had to help all developers apply the filter. gitattributes, but actually applying the filter is opt-in. If someone’s git config does not define that filter, this attribute won’t do anything. However, the filter definition – what munge-project-identifier means – is not. gitattributes file affects everyone who clones the repository since it’s committed to the repository. It might look like this: project.pbxproj filter=munge-project-identifier
Git status meaning how to#
How to SmudgeĪt the root of the repository is a. Workable, but one of those irritations that add up – elimination would remove friction. Unfortunately, we couldn’t do our daily work with those identifiers and had to maintain constant local changes to some files. I worked on a project where we lacked direct deployment access, which meant build identifiers within the code repository had to remain stable for deployment.

If you work in such a situation, git smudge and clean filters may be your solution.

Look, stuff happens, but then we’re incanting esoteric git commands to revert state, and while recoverable, the flow breakage is unwelcome. And in our day-to-day routine, we do the thing that must not be done-we commit a change we didn’t mean to commit.
Git status meaning software#
Sometimes software development requires us to make local changes to files to perform our daily work, but those changes must not be committed back to the source code repository. Git Smudge and Clean Filters: Making Changes So You Don’t Have To Oops… I Didn’t Mean To Commit That
