-
Notifications
You must be signed in to change notification settings - Fork 0
/
Set-GitConfig.ps1
44 lines (37 loc) · 1.04 KB
/
Set-GitConfig.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
[CmdLetBinding()]
param(
[switch]$vim,
$beyond = "c:/program files/beyond compare 5/bcomp.exe"
)
function Set-GitGlobals()
{
git config --global user.name "Oscar Calvo"
if ($env:USERNAME -eq "ocalvo")
{
git config --global user.email "[email protected]"
}
else
{
git config --global user.email "[email protected]"
}
git config --global log.date local
git config --global core.autocrlf true
git config --global submodule.recurse true
if ((Get-Command bcomp -ErrorAction Ignore) -ne $null)
{
git config --global diff.tool bc
git config --global difftool.prompt false
git config --global difftool.bc trustExitCode true
git config --global merge.tool bc
git config --global mergetool.prompt false
git config --global mergetool.bc trustExitCode true
git config --global difftool.bc.path $beyond
git config --global mergetool.bc.path $beyond
if ($vim.IsPresent)
{
git config --global diff.tool vimdiff
git config --global merge.tool vimdiff
}
}
}
Set-GitGlobals