Created
October 12, 2012 15:27
-
-
Save ferventcoder/3879765 to your computer and use it in GitHub Desktop.
Git SVN Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also, a pretty neat tool out there is Git Standup - written by @AnthonyMastrean - you may need to adjust the author for git-svn checkins