git

Changes to git repository immediately after cloning?


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?


Solution

  • 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.