我在Windows上使用SourceTree作为我的git客户端(v1.8.3.0)。出于某种原因,它没有显示我的PowerShell脚本(diff
)的.ps1
,而是将其显示为二进制文件:
我需要切换设置才能获得正确的行为吗?如果我将文件重命名为.txt
而不是diff
按预期工作。
我在我的仓库中有一个.gitattributes
文件,我已经更新它以明确说明.ps1
文件,但这似乎也不起作用:
*.ps1 diff=astextplain
*.PS1 diff=astextplain
或者,我可以看到qazxsw poi就好了,我去了qazxsw poi(通过Beyond Compare),但是,这并没有帮助我根据特定的行号进行提交:
diff
看起来这是Atlassian产品(BitBucket,SourceTree)的一个已知问题:External Diff
问题是我的文件被保存为UTF16 Unicode。将其更改为https://bitbucket.org/site/master/issues/5453/powershell-module-manifest-file-psd1-are或.ps1
修复此问题,我再次在SourceTree中获取UTF8
s。
你可以做(最近只有git!)
ascii
(如果用bom等删除LE)
这在你的diff
文件中