-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgh.psm1
44 lines (39 loc) · 839 Bytes
/
gh.psm1
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
<#
.SYNOPSIS
An alternative way of using some simple git commands.
.DESCRIPTION
The whole point of this was to have PowerShell like git commands instead of using the normal ones.
Why? Good learning experience.
.PARAMETER Read
-Read = git status
.PARAMETER Receive
-Receive = git pull
.PARAMETER Send
-Send = git push
.PARAMETER Write
-Write = git add .; git commit; git push
#>
function GH {
param (
[Parameter(Mandatory=$false)]
[switch]$Read,
[switch]$Receive,
[switch]$Send,
[switch]$Write
)
if ($Read) {
git status
}
elseif ($Receive) {
git pull
}
elseif ($Send) {
git push
}
elseif ($Write) {
git add .; git commit; git push
}
else {
git status
}
}