Skip to content

Instantly share code, notes, and snippets.

View searope's full-sized avatar

Sea Rope searope

View GitHub Profile
$TotalNumberVersionsToKeep=100
$BackupFolder = "\\osgdesign\Studio\Windows\Users\v-senefe\Backup" # make sure there is no ending \
$ProjectFolder = "C:\DesignDepot.Git" # make sure there is no ending \
$ProjectFolderName = [System.IO.Path]::GetFileName($ProjectFolder)
Push-Location -Path $ProjectFolder
$changes = CMD.EXE /C git ls-files --modified --others --exclude-standard | Out-String
if ($changes.Length -eq 0){
Exit
}
using System.Collections.Generic;
public class SortComparer<T, R> : Comparer<T> where R : IComparable<R>
{
public readonly Func<T, R> GetComparableProperty;
private SortComparer(){}
private SortComparer(Func<T, R> func)
{
GetComparableProperty = func;
Pushd C:\git\folder\to\copy
set share=\\path\to\a\share
del /s /f /q %share%\*.*
for /f %%f in ('dir /ad /b %share%\') do rd /s /q %share%\%%f
for /f "usebackq tokens=*" %%A in (`git ls-files --modified --others --exclude-standard`) do echo FA|xcopy "%%~fA" "%share%\%%A"