33 lines
1.1 KiB
PowerShell
33 lines
1.1 KiB
PowerShell
# 唯讀診斷:fetch 遠端並比較本地/遠端差異(不做任何改寫)
|
||
$ErrorActionPreference = 'Stop'
|
||
Set-Location (Join-Path $PSScriptRoot '..')
|
||
|
||
$git = Get-Command git -ErrorAction SilentlyContinue
|
||
if (-not $git) {
|
||
$git = 'C:\Users\ckliu\.cache\codex-runtimes\codex-primary-runtime\dependencies\native\git\cmd\git.exe'
|
||
} else { $git = $git.Source }
|
||
|
||
Write-Host '== [1] fetch 遠端(不 merge)=='
|
||
& $git fetch karylab feat/web-game
|
||
if ($LASTEXITCODE -ne 0) { throw 'fetch 失敗' }
|
||
|
||
Write-Host ''
|
||
Write-Host '== [2] 本地奇怪的近 5 筆 =='
|
||
& $git log --oneline -5 feat/web-game
|
||
|
||
Write-Host ''
|
||
Write-Host '== [3] 遠端奇怪的近 5 筆(karylab/feat/web-game)=='
|
||
& $git log --oneline -5 karylab/feat/web-game
|
||
|
||
Write-Host ''
|
||
Write-Host '== [4] 兩者共同祖先 =='
|
||
& $git merge-base feat/web-game karylab/feat/web-game
|
||
|
||
Write-Host ''
|
||
Write-Host '== [5] 遠端有、本地沒有(會被 pull 進來)=='
|
||
& $git log --oneline --left-right --cherry-pick feat/web-game...karylab/feat/web-game
|
||
|
||
Write-Host ''
|
||
Write-Host '== [6] 檔案層級差異 =='
|
||
& $git diff --stat feat/web-game karylab/feat/web-game
|