how to handle gitting of binaries, e.g. .mo files

后端 未结 3 995
轻奢々
轻奢々 2021-01-06 13:31

Is there a simple way to handle binary files in git operations? I think my ideal in this case - \'merging\' of .mo files (binary .po messages) - would be to give precedence

3条回答
  •  礼貌的吻别
    2021-01-06 14:27

    Well the best idea is not to keep generated files (such as .mo files) under version control.

    If you still want to have them in Git, use standard ways to resolve conflicts.

    For example you can get either version of conflicting file:

    git checkout --theirs -- dir/file.mo
    git checkout --ours -- dir/file.mo
    

    Or use git mergetool which will provide you both versions of conflicting file.

提交回复
热议问题