-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases.ps1
57 lines (50 loc) · 1.82 KB
/
.aliases.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# ln-like behavior
# function ln ($target, $destination) {
# New-Item -ItemType SymbolicLink -Path $target -Name $destination
# }
# env-like behavior
function env { Get-ChildItem env: }
# touch-like behavior
function touch ($item) { New-Item $item }
# which-like behavior
function which ($command) { Get-Command $command }
# File listing
# Some variation of Get-ChildItem
function ll ($dir) { Get-ChildItem -Path $dir }
function l ($dir) { Get-ChildItem -Name -Path $dir }
function la ($dir) { Get-ChildItem -Name -Force -Path $dir }
function lla ($dir) { Get-ChildItem -Force -Path $dir }
# Git function commands
Remove-Item Alias:gc -Force
Remove-Item Alias:gcm -Force
Remove-Item Alias:gl -Force
function gd { git diff }
function ga { git add }
function gb ($options) { git branch $options }
function gba { git branch -a }
function gaa { git add --all }
function gc { git commit }
function gca { git commit --all }
function gcm ($msg) { git commit -m $msg }
function gcam ($msg) { git commit --all -m $msg }
function gf ($arguments) { git fetch $arguments }
function gfp { git fetch --prune }
function gfap { git fetch --all --prune }
function g ($options) { git $options }
function gs { git status -bs -u --ahead-behind }
function gst { git status }
function glsg { git log --oneline --graph }
function glsgs { git log --oneline --graph --stat }
function glg { git log --graph }
function glgs { git log --graph --stat }
function glgp { git log --graph --patch }
function gsw ($branch) { git switch $branch }
function gsc ($branch) { git switch -c $branch }
function gpush ($arguments) { git push $arguments }
function gpull { git pull }
# Docker function commands
function disa { docker images -a }
function dpsa { docker ps -a }
function dcrit ($arguments) { docker run --rm -it $arguments }
# Terraform alias
Set-Alias -Name tf -Value terraform