Last active
October 11, 2015 02:08
-
-
Save rasmuskl/3786798 to your computer and use it in GitHub Desktop.
VSH + NP + git PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load posh-git profile | |
. 'C:\Projects\Tools\posh-git\profile.example.ps1' | |
function vsh() { | |
Write-Output "Opening first solution..." | |
$sln = (dir -in *.sln -r | Select -first 1) | |
Write-Output "Found $($sln.FullName)" | |
Invoke-Item $sln.FullName | |
} | |
function title($str) { | |
(get-host).ui.rawui.windowtitle = $str | |
} | |
function ga() { | |
Write-Output "Staging all changes..." | |
git add -A | |
git status | |
} | |
function gco() { | |
param([switch]$amend, [switch]$a) | |
$argstr = $args -join ' ' | |
$message = '"', $argstr, '"' -join '' | |
if ($amend -or $a) { | |
Write-Output "Amending previous commit with message: $message" | |
git commit -m $message --amend | |
} else { | |
Write-Output "Committing with message: $args" | |
git commit -m $message | |
} | |
} | |
function gca() { | |
$argstr = $args -join ' ' | |
$message = '"', $argstr, '"' -join '' | |
Write-Output "Amending previous commit with message: $message" | |
git commit -m $message --amend | |
} | |
set-alias -name np -value "C:\Program Files\Sublime Text 2\sublime_text.exe" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment