我试图仅提交相关更改,并保留格式。
在我的 .gitconfig
文件中,我删除了 core.autocrlf = input
行以跳过行结束转换。
但现在我不知道为什么我的行结束符仍然被转换。
已经检查了类似的解决方案,但没有效果。 我只想提交非空格的更改。
我尝试了:
git add myfile
git diff HEAD
--- /dev/null
+++ b/profiles/minimal/minimal.info
@@ -0,0 +1,6 @@
...content of file here (practically all is changed)
现在需要去除空格。
git diff HEAD -w | git apply --cached --ignore-whitespace
我收到一个错误提示
error: myfile: already exists in index