Why does git think my .sql file is a binary file?

前端 未结 6 1518
-上瘾入骨i
-上瘾入骨i 2020-12-04 16:14

I have some .sql files that I just for the first time pushed to github. However when I look at the commit it is saying:

BIN  WebRole/Sql/Database.sql Vi         


        
6条回答
  •  粉色の甜心
    2020-12-04 17:03

    Using the accepted answer from the linked question and a few other comments I came up with this as a solution to the issue, which is working and runs on Win10

    $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
    Get-ChildItem -Recurse *.sql | foreach {
        $MyPath = $_.FullName;
        $Contents = Get-Content $MyPath
        [System.IO.File]::WriteAllLines($MyPath, $Contents, $Utf8NoBomEncoding)
    }
    

提交回复
热议问题