Merhaba Git ve Hg'nin büyük bir hayranıyım ve bunları birçok projede kullanmam gerekiyor. Şu anda, geçerli dalı ve olağanüstü taahhüdünü powershell'inize yerleştiren bir powershell eklentisi olan Posh-Hg'yi kullanıyorum. Posh-Git, Git haricinde benzer şekilde çalışır. Birbirinizle birlikte oynamak için iki güç komutanı başarılı bir şekilde aldı mı? O sorun artık sabittir,Posh-Git ve Posh-Hg Birlikte mi?
function isCurrentDirectoryARepository($type) {
if ((Test-Path $type) -eq $TRUE) {
return $TRUE
}
# Test within parent dirs
$checkIn = (Get-Item .).parent
while ($checkIn -ne $NULL) {
$pathToTest = $checkIn.fullname + '/' + $type;
if ((Test-Path $pathToTest) -eq $TRUE) {
return $TRUE
} else {
$checkIn = $checkIn.parent
}
}
return $FALSE
}
# Posh-Hg and Posh-git prompt
. $ProfileRoot\Modules\posh-hg\profile.example.ps1
. $ProfileRoot\Modules\posh-git\profile.example.ps1
function prompt(){
# Reset color, which can be messed up by Enable-GitColors
$Host.UI.RawUI.ForegroundColor = $GitPromptSettings.DefaultForegroundColor
Write-Host($pwd) -nonewline
if (isCurrentDirectoryARepository(".git")) {
# Git Prompt
$Global:GitStatus = Get-GitStatus
Write-GitStatus $GitStatus
} elseif (isCurrentDirectoryARepository(".hg")) {
# Mercurial Prompt
$Global:HgStatus = Get-HgStatus
Write-HgStatus $HgStatus
}
return "> "
}
Bu gece bunu deneyeceğim ve işe yarayıp yaramadığını görüyorum, buna cevap vermeye çalıştığınız için teşekkürler. –
IT ÇALIŞIYOR !! Sana birden fazla onay işareti verebilirsem, kesinlikle yapardım. –
Bunun için teşekkürler, benim için de harika çalıştı. –