Skip to content

Instantly share code, notes, and snippets.

@wahidshalaly
Created September 10, 2015 02:05
Show Gist options
  • Save wahidshalaly/610d3fd54ce2dbc36fd8 to your computer and use it in GitHub Desktop.
Save wahidshalaly/610d3fd54ce2dbc36fd8 to your computer and use it in GitHub Desktop.
# Gitin & Gitout Workarounds
$activeRepo = ".git"
$inactiveRepo = "project.git"
Function Rename-GitRepositoryToStart
{
$curPath = Join-Path $(Get-Location) $inactiveRepo
$newPath = Join-Path $(Get-Location) $activeRepo
If (Test-Path -Path $curPath)
{
Rename-Item -Path $curPath -NewName $newPath
}
}
Function Rename-GitRepositoryToStop
{
$curPath = Join-Path $(Get-Location) $activeRepo
$newPath = Join-Path $(Get-Location) $inactiveRepo
If (Test-Path -Path $curPath)
{
Rename-Item -Path $curPath -NewName $newPath
}
}
Set-Alias gitin Rename-GitRepositoryToStart
Set-Alias gitout Rename-GitRepositoryToStop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment