Git 状态忽略行尾/相同的文件/windows &linux环境/dropbox/meld [英] Git status ignore line endings / identical files / windows & linux environment / dropbox / meld

查看:44
本文介绍了Git 状态忽略行尾/相同的文件/windows &linux环境/dropbox/meld的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何制作

git 状态

忽略行尾差异?

背景信息:

我随机使用 Windows 和 Linux 来处理该项目.该项目在 Dropbox 中.

I use randomly Windows and Linux to work on the project. The project is in Dropbox.

我发现了很多关于如何让 git diff 忽略行尾的信息.由于我使用 meld git diff 为每个文件打开 meld.和 meld 说相同的文件".

I found a lot about how do make git diff ignore line endings. Since i use meld git diff opens meld for each file. And meld says "identical file".

那么我该如何避免这种情况.Git 应该只为更改的文件打开 meld.如果只有文件结尾不同,git status 不应报告文件已更改.

So how do I avoid this. Git should only open meld for changed files. And git status should not report files as changed if only the file ending is different.

原因:

发生这种情况是因为 Windows 上的此设置

This happened because of this setting on Windows

core.autocrlf 真

core.autocrlf true

所以我检查了 Linux 上的工作副本,并在 Windows 上设置了 core.autocrlf false.

So I checked out the working copy on Linux and set core.autocrlf false on Windows.

知道如何让 git status 忽略不同的新行还是很好的.

It would be still nice to know how to make git status ignore different new lines.

推荐答案

尝试像这样设置 core.autocrlf 值:

Try setting core.autocrlf value like this :

git config --global core.autocrlf true

这篇关于Git 状态忽略行尾/相同的文件/windows &linux环境/dropbox/meld的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆