diff --git a/scripts/Common/Software/git/main.fish b/scripts/Common/Software/git/main.fish index 4bd8dfd6..0951fcec 100644 --- a/scripts/Common/Software/git/main.fish +++ b/scripts/Common/Software/git/main.fish @@ -7,7 +7,10 @@ begin sudo git config --system $argv end - setConfig init.defaultBranch "main" + if isSet "$branch" + setConfig init.defaultBranch (getConfig "$branch") + end + setConfig user.name "Manuel Thalmann" setConfig user.email "m@nuth.ch" @@ -15,6 +18,7 @@ begin set -l dir (mktemp -d) pushd "$dir" > /dev/null + begin git init git commit --allow-empty -m "Initial commit" > /dev/null git branch master || true &> /dev/null @@ -23,6 +27,7 @@ begin yes "" | git flow init &> /dev/null sudo git flow config set --system master main > /dev/null sudo git flow config set --system develop dev > /dev/null + end popd > /dev/null rm -rf "$dir"