I can only ever remember git add, commit, diff, rm and push...and I couldn't be bothered to rtfm (Confessions of a powershell numpty, #1)
I don’t use git much, and I’m far too lazy to consult the docco so to find a command I’d probably used before I did this:
hhh git | where-object line -notmatch 'diff|add|push|commit| rm '
….where hhh is an alias to a crappy little function I wrote:
function get-MTPSavePAthHistory {
<#
.SYNOPSIS
Search through history
#>
[CmdletBinding()]
Param ($Pattern = "*",
$Tail = 50)
[string]$HistoryFile = $(Get-PSReadLineOption).HistorySavePAth
if ($Pattern -eq "*") {
get-content -tail $Tail
}
else {
Select-string "$Pattern" $HistoryFile | select-object line
}
}
Set-Alias -Name hhh -Value get-MTPSavePAthHistory
What I really did
It gets worse
Because I am a numpty, and I couldn’t remember whether whether -notmatch would work in this context, what I really did was this:
hhh git | ? line -notlike "*add*" | ? line -notlike "*diff*" | ? line -notlike "*commit*"| ? line -notlike "*push*"