-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMicrosoft.PowerShell_profile.ps1
More file actions
125 lines (95 loc) · 3.14 KB
/
Copy pathMicrosoft.PowerShell_profile.ps1
File metadata and controls
125 lines (95 loc) · 3.14 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
New-Alias -Name ginit -Value gitinit
function gitinit() {
$arg1 = "init"
Start-Process git -ArgumentList $arg1 -Wait -NoNewWindow
}
New-Alias -Name fetch -Value gitfetch
function gitfetch() {
$arg1 = "fetch"
Start-Process git -ArgumentList $arg1 -Wait -NoNewWindow
}
New-Alias -Name merge -Value gitmerge
function gitmerge(){
$arg1 = "merge"
Start-Process git -ArgumentList $arg1 -Wait -NoNewWindow
}
New-Alias -Name push -Value gitpush
function gitpush(){
$arg1 = "push"
Start-Process git -ArgumentList $arg1 -Wait -NoNewWindow
}
New-Alias -Name pull -Value gitpull
function gitpull(){
$arg1 = "pull"
Start-Process git -ArgumentList $arg1 -Wait -NoNewWindow
}
New-Alias -Name gstat -Value gitstatus
function gitstatus(){
$arg1 = "status"
Start-Process git -ArgumentList $arg1 -Wait -NoNewWindow
}
New-Alias -Name log -Value gitlog
function gitlog{
$arg1 = "log"
Start-Process git -ArgumentList $arg1 -Wait -NoNewWindow
}
###...THESE ALIASES BELOW TAKE ARGUMNETS LIKE <branch-name> <url> AND SO ON...###
New-Alias -Name branch -Value gitBranch
function gitBranch([string]$branchName) {
$arg1 = "branch"
$allArgs = @($arg1, $branchName)
Start-Process git -ArgumentList $allArgs -Wait -NoNewWindow
}
New-Alias -Name clone -Value gitclone
function gitclone([string]$url) {
$arg1 = "clone"
$allArgs = @($arg1, $url)
Start-Process git -ArgumentList $allArgs -Wait -NoNewWindow
}
New-Alias -Name add -Value gitadd
function gitadd([string]$file){
$arg1 = "add"
$allArgs = @($arg1, $file)
Start-Process git -ArgumentList $allArgs -Wait -NoNewWindow
}
###There was a persisting error that suggested that Git was interpreting each word in the commit message as a separate file path
###Using the git.exe executable directly, rather than relying on the Start-Process cmdlet fixed the previous problem
###Make sure to adjust the path to git.exe if it's not in your system's PATH.
New-Alias -Name commit -Value gitcommit
function gitcommit([string]$message){
$arg1 = "commit"
$arg2 = "-m"
$allArgs = @($arg1, $arg2, $message)
& "git.exe" $allArgs
}
New-Alias -Name checkout -Value gitcheckout
function gitcheckout([string]$branchName){
$arg1 = "checkout"
$allArgs = @($arg1, $branchName)
Start-Process git -ArgumentList $allArgs -Wait -NoNewWindow
}
New-Alias -Name gdiff -Value gitdiff
function gitdiff([string]$branchName1, [string]$branchName2){
$arg1 = "diff"
$allArgs = @($arg1, $branchName1, $branchName2 )
Start-Process git -ArgumentList $allArgs -Wait -NoNewWindow
}
New-Alias -Name show -Value gitshow
function gitshow([string]$commit){
$arg1 = "show"
$allArgs = @($arg1, $commit)
Start-Process git -ArgumentList $allArgs -Wait -NoNewWindow
}
New-Alias -Name branchd -Value gitbranchd
function gitbranchd([string]$branchName){
$arg1 = "branch"
$arg2 = "-d"
$allArgs = @($arg1, $arg2, $branchName)
Start-Process git -ArgumentList $allArgs -Wait -NoNewWindow
}
New-Alias -Name reset -Value gitreset
function gitreset([string]$commit){
$arg1 = "reset"
$allArgs = @($arg1, $commit)
Start-Process git -ArgumentList $allArgs -Wait -NoNewWindow
}