-
Notifications
You must be signed in to change notification settings - Fork 22
/
CreateAliases.ps1
48 lines (47 loc) · 1.31 KB
/
CreateAliases.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
Set-Alias pester invoke-pester
Set-Alias psake invoke-psake
Set-Alias k kubectl
function add {
if ($args) {
Invoke-Expression ( "git add " + ($args -join ' ') )
} else {
git add -A :/
}
}
if (Get-Command Add-Alias -ErrorAction Ignore) {
Add-Alias st 'git status'
Add-Alias push 'git push'
Add-Alias pushf 'git push -f'
Add-Alias pull 'git pull'
Add-Alias log 'git log'
Add-Alias ci 'git commit'
Add-Alias co 'git checkout'
Add-Alias dif 'git diff'
Add-Alias rs 'git reset'
Add-Alias rb 'git rebase'
Add-Alias fixup 'git fixup'
Add-Alias branch 'git branch'
Add-Alias tag 'git tag'
Add-Alias up 'git up'
Add-Alias sync 'git sync'
if ($lsApp = Get-Command ls -CommandType Application -ErrorAction Ignore) {
Add-Alias ll "$($lsApp.Source) -la"
Remove-Variable lsApp
} else {
Add-Alias ll 'ls -Force'
}
}
Set-Alias l 'ls'
if (Get-Command hub -ErrorAction Ignore) {
Set-Alias git "$($(Get-Command hub).Source)"
}
if (Get-Command curl -CommandType Application -ErrorAction Ignore) {
#use system curl if available
if (Get-Alias curl -ErrorAction Ignore) {
Remove-Item alias:curl
}
}
function pushsync() {
$branch = $(git rev-parse --abbrev-ref HEAD)
git push --set-upstream origin $branch
}