I wanted to transfer many git repos from my old Windows 7 machine (git 2.6.3.windows.1) to the new one under Ubuntu 16.04 (git 2.7.4). Since not all of them had a remote repos I decided simply copy them. This should work. However, all tracked files in all repos became unstaged. Actually there are possible some of them which were not committed before repos transferring but the majority of them were committed.
If I look at
diff for the file which was committed before repo transferring with a command:
$git log -p -1 .gitignore commit c566830cd3ffdf96556d29aee8dd1dc95d359872 Author: Pavel <email@example.com> Date: Fri May 13 18:07:25 2016 +0300 Start diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2535fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +__pycache__ +.idea +test
it returns the reference to the last commit where this file was actually committed. The commit in the example above is the first one in the repo.
So, for some reason git refuses to recognize committed files but link them to the last commit where they were actually committed.
Is it the incompatibility issue of different git versions or platforms or something else? And how to solve this issue and don't brake repos?