Better....
Better Edit-DokcerCompose (suppress errors when permissions don't allow) Better aliases (eds and edc) Better Git commands.
This commit is contained in:
parent
86fdee1acc
commit
33b4c5166b
7 changed files with 59 additions and 7 deletions
|
@ -1,7 +1,15 @@
|
|||
$local:workTree = git worktree list --porcelain | Select-String worktree | ForEach-Object { $_ -split 'worktree ' } | Where-Object { $_ }
|
||||
[CmdletBinding(SupportsShouldProcess)]param(
|
||||
[switch]$sudo
|
||||
)
|
||||
$local:workTree = git worktree list --porcelain |
|
||||
Select-String worktree |
|
||||
ForEach-Object { $_ -split 'worktree ' } |
|
||||
Where-Object { $_ }
|
||||
$local:sudoCmd = [string]::Empty
|
||||
if( $sudo ) { $sudoCmd = "env sudo" }
|
||||
Push-Location $workTree
|
||||
$null = git reset HEAD
|
||||
$null = git rm --cached -r .
|
||||
$null = git add .
|
||||
$null = Invoke-Expression "& $sudoCmd git reset HEAD 2>&1"
|
||||
$null = Invoke-Expression "& $sudoCmd git rm --cached -r . 2>&1"
|
||||
$null = Invoke-Expression "& $sudoCmd git add . 2>&1"
|
||||
git status
|
||||
Pop-Location
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue