为 Git GUI 差异窗口设置 UTF-8 显示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23151339/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:57:38  来源:igfitidea点击:

Set UTF-8 display for Git GUI differences window

gitutf-8diffgit-diffgit-gui

提问by Paul

I can't remember how I made Git GUI to display UTF-8 encoded differences correctly. Also I can't find the guide in search engines.

我不记得我是如何让 Git GUI 正确显示 UTF-8 编码的差异的。我也无法在搜索引擎中找到指南。

Now I need to do this at new workplace. Could you write down instructions?

现在我需要在新的工作场所做这件事。你能写下说明吗?

OS: Windows 7

操作系统:Windows 7

回答by Fabio Crisci

# Global setting for all you repositories
> git config --global gui.encoding utf-8

# For one repository only
> git config gui.encoding utf-8

Or from the GUI window:

或从 GUI 窗口:

Edit -> Options... -> Default File Contents Encoding -> Change

编辑 -> 选项... -> 默认文件内容编码 -> 更改

and select "Unicode (UTF-8)"

并选择“Unicode (UTF-8)”

In the Options, you'll see that there are two panel, the one on the right is for all repositories, the one on the left for the local repository.

在选项中,您会看到有两个面板,右侧的一个用于所有存储库,左侧的一个用于本地存储库。