Read more

Prohibit Git from merging .po-files

Tobias Kraze
March 22, 2011Software engineer at makandra GmbH

Merging .po-files with Git is painful.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

There have been attempts Show archive.org snapshot of making Git more clever when trying to merge .po-files. I believe however that this is not enough as it can still produce invalid .pos (usually due to double definitions), which can seriously confuse gettext afterwards.

Lacking any more secure solution, I think you should avoid editing po files in different branches at the same time. In order to not accidentally produce invalid merges I additionally disable merging for po files altogether, by adding the following .gitattributes file to the root of the repository:

*.po   merge=binary
*.pot  merge=binary
Posted by Tobias Kraze to makandra dev (2011-03-22 11:39)