git - 提交编码更改

标签 git encoding

我有一些使用 us-ascii 编码的文件已提交到存储库。当我将编码更改为 utf-8 时,我无法提交,因为我得到:

$ git status
# On branch master
nothing to commit (working directory clean)

如何提交此类更改?

最佳答案

来自@reactormonk 的 6 年前的评论对我有用。我在文件中放了一条评论,其中评论有一个 UTF-8 字符。提交该更改,将文件编码设置为 UTF-8。

关于git - 提交编码更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16664255/

相关文章:

git:如何在通过文件删除进行 rebase 提交时不删除文件

rust - 在 Rust 中使用 serde 对包含具有无效 utf-8 字符的路径的 PathBuf 进行编码

gitlab-shell -> git push -u origin master -> fatal : The remote end hung up unexpectedly

git - Visual Studio 不会撤消我的 git 更改

尽管更改是远程进行的,但 Git 说是最新的

python - 将值列表转换为编码变量?

python - 读取带有德语字符的 json 文件 python 2 (ironpython)

html - 这是网页还是图片?

ios - 在 iOS 上将 UIImage 编码为 base64 字符串

git - 在 github 中查看用户的全部事件