Add a script for restoring git

This commit is contained in:
Manuel Thalmann 2023-06-22 20:44:40 +02:00
parent 0ccc870584
commit e064c3fd01
6 changed files with 24 additions and 11 deletions

View file

@ -0,0 +1,8 @@
git init;
git commit --allow-empty -m "Initial commit" > /dev/null;
git branch master || true;
git branch main || true;
git branch dev || true;
yes "" | git flow init > /dev/null 2>&1;
git flow config set --global master main > /dev/null;
git flow config set --global develop dev > /dev/null;

View file

@ -0,0 +1,8 @@
$tempDir = Join-Path $([System.IO.Path]::GetTempPath()) $([System.IO.Path]::GetRandomFileName());
$null = New-Item -ItemType Directory $tempDir;
Push-Location "$tempDir";
. "$PSScriptRoot/config.sh";
Pop-Location;
Remove-Item -Recurse "$tempDir";

View file

@ -1,13 +1,6 @@
#!/bin/bash
contextRoot="$(mktemp -d)";
pushd "$contextRoot" > /dev/null;
git init;
git commit --allow-empty -m "Initial commit" > /dev/null;
git branch master || true;
git branch main || true;
git branch dev || true;
yes "" | git flow init > /dev/null 2>&1;
git flow config set --global master main > /dev/null;
git flow config set --global develop dev > /dev/null;
. "${BASH_SOURCE%/*}/config.sh";
popd > /dev/null;
rm -rf "$contextRoot";

View file

@ -0,0 +1,2 @@
. "$PSScriptRoot/setup/install.sh";
. "$PSScriptRoot/flow/install.ps1";

View file

@ -60,6 +60,7 @@ function Invoke-WindowsRestore([Context] $context) {
}
Invoke-FileRestore $context;
Invoke-RestoreGit $context;
Remove-Item -Recurse $context.RootDir;
}

View file

@ -1,8 +1,9 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$configBaseName = ".gitconfig";
$configPath = Join-Path "$HOME" "$configBaseName";
function Invoke-BackupGit([Context] $context) {}
function Invoke-RestoreGit([Context] $context) {
. "$PSScriptRoot/../../../Common/Config/git/install.ps1";
}
}