Add a script for restoring git
This commit is contained in:
parent
0ccc870584
commit
e064c3fd01
6 changed files with 24 additions and 11 deletions
scripts/Common/Config/git/flow
8
scripts/Common/Config/git/flow/config.sh
Normal file
8
scripts/Common/Config/git/flow/config.sh
Normal 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;
|
8
scripts/Common/Config/git/flow/install.ps1
Normal file
8
scripts/Common/Config/git/flow/install.ps1
Normal 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";
|
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue