forked from ScoopInstaller/Scoop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
git.ps1
52 lines (41 loc) · 881 Bytes
/
git.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
function git_proxy_cmd {
$proxy = get_config 'proxy'
$cmd = "git $($args | ForEach-Object { "$_ " })"
if($proxy -and $proxy -ne 'none') {
$cmd = "SET HTTPS_PROXY=$proxy&&SET HTTP_PROXY=$proxy&&$cmd"
}
& "$env:COMSPEC" /c $cmd
}
function git_clone {
git_proxy_cmd clone $args
}
function git_ls_remote {
git_proxy_cmd ls-remote $args
}
function git_checkout {
git_proxy_cmd checkout $args
}
function git_branch {
git_proxy_cmd branch $args
}
function git_pull {
git_proxy_cmd pull $args
}
function git_fetch {
git_proxy_cmd fetch $args
}
function git_log {
git_proxy_cmd --no-pager log $args
}
function git_checkout {
git_proxy_cmd checkout $args
}
function git_branch {
git_proxy_cmd branch $args
}
function git_config {
git_proxy_cmd config $args
}
function git_reset {
git_proxy_cmd reset $args
}