Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Created October 12, 2012 15:27
Show Gist options
  • Save ferventcoder/3879765 to your computer and use it in GitHub Desktop.
Save ferventcoder/3879765 to your computer and use it in GitHub Desktop.
Git SVN Setup
[alias]
spull = !git checkout master && git svn rebase
spush = !git checkout master && git svn dcommit
work = !git checkout work && git rebase master
prepwork = !git checkout work && git rebase master && git checkout master && git merge work
SET URL=%1
SET FOLDERNAME=%2
::http://stackoverflow.com/a/2348596/18475
git svn clone -r HEAD %URL% %FOLDERNAME%
::The above is a single branch or the trunk. If you want all of them, adjust your url accordingly and use this instead:
::git svn clone --stdlayout -r HEAD %URL% %FOLDERNAME%
$scriptDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
function Install-NeededFor {
param(
[string] $packageName = ''
,[bool] $defaultAnswer = $true
)
if ($packageName -eq '') {return $false}
$yes = '6'
$no = '7'
$msgBoxTimeout='-1'
$defaultAnswerDisplay = 'Yes'
$buttonType = 0x4;
if (!$defaultAnswer) { $defaultAnswerDisplay = 'No'; $buttonType= 0x104;}
$answer = $msgBoxTimeout
try {
$timeout = 10
$question = "Do you need to install $($packageName)? Defaults to `'$defaultAnswerDisplay`' after $timeout seconds"
$msgBox = New-Object -ComObject WScript.Shell
$answer = $msgBox.Popup($question, $timeout, "Install $packageName", $buttonType)
}
catch {
}
if ($answer -eq $yes -or ($answer -eq $msgBoxTimeout -and $defaultAnswer -eq $true)) {
write-host "Installing $packageName"
return $true
}
write-host "Not installing $packageName"
return $false
}
#install chocolatey
if (Install-NeededFor 'chocolatey') {
iex ((new-object net.webclient).DownloadString("http://bit.ly/psChocInstall"))
}
if (Install-NeededFor 'gitextensions') {
cinst gitextensions
}
@ferventcoder
Copy link
Author

Also, a pretty neat tool out there is Git Standup - written by @AnthonyMastrean - you may need to adjust the author for git-svn checkins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment