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
scripts/Common/Config/git/flow

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";