EthanBrown.GitConfiguration
- A number of "standard" Git config options on Win core.autocrlf true core.safecrlf false rebase.autosquash true help.format html push.default simple core.editor Notepad++ diff.tool DiffMerge diff.guitool DiffMerge merge.tool DiffMerge
This commit is contained in:
51
EthanBrown.GitConfiguration/tools/chocolateyInstall.ps1
Normal file
51
EthanBrown.GitConfiguration/tools/chocolateyInstall.ps1
Normal file
@@ -0,0 +1,51 @@
|
||||
$package = 'EthanBrown.GitConfiguration'
|
||||
|
||||
try {
|
||||
# Set up git diff/merge tool
|
||||
git config --global mergetool.DiffMerge.cmd '\"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe\" --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" --title1=\"Mine\" --title2=\"Merging to: $MERGED\" --title3=\"Theirs\"'
|
||||
git config --global mergetool.DiffMerge.trustExitCode true
|
||||
git config --global difftool.DiffMerge.cmd '\"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe\" \"$LOCAL\" \"$REMOTE\" --title1=\"Previous Version ($LOCAL)\" --title2=\"Current Version ($REMOTE)\"'
|
||||
|
||||
$defaultMerge = git config --get merge.tool
|
||||
if (!$defaultMerge -or ($defaultMerge -match 'kdiff'))
|
||||
{
|
||||
git config --global merge.tool DiffMerge
|
||||
}
|
||||
git config --global mergetool.keepBackup false
|
||||
git config --global mergetool.prompt false
|
||||
|
||||
$defaultDiff = git config --get diff.tool
|
||||
if (!$defaultDiff -or ($defaultDiff -match 'kdiff'))
|
||||
{
|
||||
git config --global diff.tool DiffMerge
|
||||
}
|
||||
$defaultDiff = git config --get diff.guitool
|
||||
if (!$defaultDiff -or ($defaultDiff -match 'kdiff'))
|
||||
{
|
||||
git config --global diff.guitool DiffMerge
|
||||
}
|
||||
git config --global difftool.prompt false
|
||||
|
||||
$defaultPush = git config --get push.default
|
||||
if (!$defaultPush)
|
||||
{
|
||||
git config --global push.default simple
|
||||
}
|
||||
|
||||
git config --global core.autocrlf true
|
||||
git config --global core.safecrlf false
|
||||
$defaultEditor = git config --get core.editor
|
||||
if (!$defaultEditor)
|
||||
{
|
||||
git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugins"
|
||||
}
|
||||
|
||||
git config --global pack.packSizeLimit 2g
|
||||
git config --global help.format html
|
||||
git config --global rebase.autosquash true
|
||||
|
||||
Write-ChocolateySuccess $package
|
||||
} catch {
|
||||
Write-ChocolateyFailure $package "$($_.Exception.Message)"
|
||||
throw
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
$package = 'EthanBrown.GitConfiguration'
|
||||
|
||||
try {
|
||||
Write-Host "Manually edit $ENV:USERPROFILE\.gitconfig to revert package changes"
|
||||
Write-ChocolateySuccess $package
|
||||
} catch {
|
||||
Write-ChocolateyFailure $package "$($_.Exception.Message)"
|
||||
throw
|
||||
}
|
Reference in New Issue
Block a user