This has happened twice. The first time to 4 or 5 files. The second time to just one, but I was only pushing one at the time. I am using Visual Studio 2013 to edit PowerShell scripts. I don't know if this is relevant as I think they are just UTF-8 files when Git deals with them. I'm not sure if it's at the time of commit or push but my files are getting messed up. An example of the first few lines when it's clean:
$Start=Get-Date
$Global:Timings=@()
$Global:Timings+=1
#$Global:Timings+=2
function Stamp($msg){ $Global:Timings += @{Date=(Get-Date).addseconds(4);Message=$msg} }
I pushed that at work and when I got home and pulled it, I get: http://pastebin.com/EgVzZZHs
The new file is full of when I am thinking are Chinese characters. I had to use pastebin because superuser doesn't allow those characters. According to some file analysis, the original is UTF-8 while the new file is UTF-16 Big Endian. The file looks similarly messed up in Notepad, SciTe, Visual Studio, WinMerge, and the tools in Tortoise Git. I suspect (based on my recollection of the last time this happened) but can't verify at the moment, that the file on my disk at work will be fine. I don't know if Git's index will be messed up, but I think if I pull, the good file will get replaced with the bad file. Both clients are Windows 7. The remote repo is on BitBucket. It's only a week or so old. Does anyone have any idea what's happening and/or how to prevent it? I'm super bummed out about this. Many thanks!