Remotes: kalinamall, home, github по SSH (.ru); origin убран.

Set-GitRemotes переименует origin по хосту; SSH config для .ru через LAN IP.
This commit is contained in:
2026-06-18 11:34:03 +10:00
parent 7f8e7c0cb2
commit 4caedb3074
8 changed files with 77 additions and 39 deletions
+4 -4
View File
@@ -7,7 +7,7 @@
param(
[Parameter(Mandatory = $true)][string]$Root,
[string]$RulesDest = '',
[string]$CloneUrl = 'ssh://git@git.kalinamall.lan:2222/PapaTramp/Rules.git',
[string]$CloneUrl = 'ssh://git@git.kalinamall.ru:2222/PapaTramp/Rules.git',
[string]$HttpsCloneUrl = 'https://git.kalinamall.ru/PapaTramp/Rules.git',
[switch]$SkipClone,
[switch]$SkipProfile,
@@ -66,7 +66,7 @@ function Test-MachineGitReady {
if (-not (Test-Path -LiteralPath $keyPath)) { return $false }
}
if ($sshText -notmatch '(?m)^Host\s+git\.kalinamall\.lan\s*$') { return $false }
if ($sshText -notmatch '(?m)^Host\s+git\.kalinamall\.ru\s*$') { return $false }
return $true
}
@@ -182,8 +182,8 @@ $registerArgs = @{ ConfigDir = $configDir; WhatIf = $WhatIf.IsPresent }
& (Join-Path $Root 'scripts\Register-GiteaSshKeys.ps1') @registerArgs
if (-not $WhatIf) {
Write-Step 'Testing git@git.kalinamall.lan'
ssh -T -o BatchMode=yes -o ConnectTimeout=10 git@git.kalinamall.lan 2>&1 | ForEach-Object { Write-Host $_ }
Write-Step 'Testing git@git.kalinamall.ru'
ssh -T -o BatchMode=yes -o ConnectTimeout=10 git@git.kalinamall.ru 2>&1 | ForEach-Object { Write-Host $_ }
}
}
elseif ($gitReady) {