克隆后立即对git存储库进行更改? [英] Changes to git repository immediately after cloning?

查看:117
本文介绍了克隆后立即对git存储库进行更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚刚克隆了这个,该目录立即发生了变化?



我从未遇到过这样的事情,我很好奇为什么会发生这种情况?这是甚至可能的?



更新:



我使用 git clone git://github.com/horndude77/open-scores.git 并且在运行git status后显示: git status
#目前没有任何分支。
#没有为commit提交更改:
#(使用git add< file> ...更新将提交的内容)
#(使用git checkout - <文件> ...放弃工作目录中的更改)

#修改:SaintSaensRomanceOp36 / defs.ily
#修改:SaintSaensRomanceOp36 / horn.ily

没有更改添加到提交(使用git add和/或git commit -a)

git diff显示:

 警告:在SaintSaensRomanceOp36 / defs.ily中,CRLF将被LF代替。 
该文件将在工作目录中具有其原始行结尾。
警告:在SaintSaensRomanceOp36 / horn.ily中,CRLF将被LF取代。
该文件将在工作目录中具有其原始行结尾。
diff --git a / SaintSaensRomanceOp36 / defs.ily b / SaintSaensRomanceOp36 / defs.ily
index 07e09ac..c7961be 100644
--- a / SaintSaensRomanceOp36 / defs.ily
+++ b / SaintSaensRomanceOp36 / defs.ily
@@ -1,47 +1,47 @@
-\version2.13.13



注意:只包含diff的顶部,因为它很长。



当我克隆存储库时,是否删除了CRLF字符,如果有的话,它们是如何包含在对bigin的提交中?

解决方案

在克隆存储库时,会自动删除在Windows计算机上进行提交时包含的CRLF字符。然后,Git检测到这一变化,因此在用户完成除 git clone 以外的其他任何事情后克隆了存储库。



我通过从我的 .gitattributes 文件中删除 * text = auto 来解决此问题。


Having just cloned this, the directory immediately has changes in it?

I have never encountered something like this and I am curious why this is happening? and how this is even possible?

UPDATE:

I cloned the repo using git clone git://github.com/horndude77/open-scores.git and imediately after running git status reveals:

git status
# Not currently on any branch.
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   SaintSaensRomanceOp36/defs.ily
#       modified:   SaintSaensRomanceOp36/horn.ily
#
no changes added to commit (use "git add" and/or "git commit -a")

git diff reveals:

warning: CRLF will be replaced by LF in SaintSaensRomanceOp36/defs.ily.
The file will have its original line endings in your working directory.
warning: CRLF will be replaced by LF in SaintSaensRomanceOp36/horn.ily.
The file will have its original line endings in your working directory.
diff --git a/SaintSaensRomanceOp36/defs.ily b/SaintSaensRomanceOp36/defs.ily
index 07e09ac..c7961be 100644
--- a/SaintSaensRomanceOp36/defs.ily
+++ b/SaintSaensRomanceOp36/defs.ily
@@ -1,47 +1,47 @@
-\version "2.13.13"
.
.
.

NOTE: only the top of the diff is included as it was very long.

Is it removing the CRLF characters when I clone the repository and if so how were these ever included in a commit to bigin with?

解决方案

The CRLF characters included when the commit was made on a windows machine are automatically removed when the repository is cloned. Git then detects this change and hence the repository is modified right after cloning with the user having done anything other than a git clone.

I fixed this by removing * text=auto from my .gitattributes file.

这篇关于克隆后立即对git存储库进行更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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