简体   繁体   English

在分支之间切换会导致变化

[英]Switching between branches causes changes

When I switch between branches, it causes changes on the branch that I switch to, and the changes is always to random files.当我在分支之间切换时,它会导致我切换到的分支发生更改,并且更改始终是随机文件。 When looking at the changes, there is nothing different but it is insisting that something has changed.在查看变化时,没有什么不同,但坚持认为某些事情已经发生了变化。 When I undo changes, it doesn't do anything.当我撤消更改时,它什么也不做。 The only thing I can do to proceed is to commit those files, then continue working.我唯一能做的就是提交这些文件,然后继续工作。

Also committing png and zip files causes the files to become corrupt on the git repo, so others who sync will get messed up files.同时提交 png 和 zip 文件会导致文件在 git repo 上损坏,因此其他同步的人会弄乱文件。

I thought it might be to do with the line-endings, but I'm fairly new to git and not sure how to resolve this random issue.我认为这可能与行尾有关,但我对 git 相当陌生,不确定如何解决这个随机问题。 Any ideas?有什么想法吗?

Here is a git diff of a file that shows changes:这是显示更改的文件的 git diff:

diff --git a/Presentation/Emails.vb b/Presentation/Emails.vb
index a767a0d..91e9613 100644
--- a/Presentation/Emails.vb
+++ b/Presentation/Emails.vb
@@ -1,351 +1,351 @@
-<U+FEFF>Imports System.Data
-Imports System.Web
-
....rest of the file

I notice it has "U+FEFF" at the start, what does this mean?我注意到它的开头有“U+FEFF”,这是什么意思?

Also committing png and zip files causes the files to become corrupt on the git repo,同时提交 png 和 zip 文件会导致文件在 git repo 上损坏,

Make sure that git config core.autocrlf is set to false.确保 git config core.autocrlf 设置为 false。
If not, it will mess up binary files, trying to change "end-of-line" character sequences which are not "eol" in said binary.如果不是,它会弄乱二进制文件,试图更改在所述二进制文件中不是“eol”的“行尾”字符序列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM