git - 如何重新规范化我的 git 存储库

标签 git line-endings core.autocrlf

我已将 core.autocrlf 选项更新为 true(在 Windows 下);现在我想重新规范我的 git 存储库。我怎样才能做到这一点?

最佳答案

git rm --cached -r .
# Remove everything from the index.

git reset --hard
# Write both the index and working directory from git's database.

git add .
# Prepare to make a commit by staging all the files that will get normalized.
# This is your chance to inspect which files were never normalized. You should
# get lots of messages like: "warning: CRLF will be replaced by LF in file."

git commit -m "Normalize line endings"
# Commit

引用:https://help.github.com/articles/dealing-with-line-endings

关于git - 如何重新规范化我的 git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22109740/

相关文章:

r - 尝试将 .csv 文件读入 R 时出现“不完整的最后一行”警告

windows - 无法让 git autocrlf=true 工作

git - 在 merge 之前查找哪些文件存在冲突?

git - 放弃未暂存的文件夹

windows - 如何在类似 Unix 的 Visual Studio Code 中的所有文件中制作所有行结尾 (EOL)?

git - 何时将 --keep-cr 与 am 一起使用以及它是在哪个版本的 git 中引入的?

git - 使用 : git config --global core. autocrlf false 是否有任何风险或缺点

Git:如何将子目录推送到同一存储库的单独分支

git - 是否可以检测站点是否正在使用版本控制系统

Python 编解码器行结尾