Dotfile : Do not fail if master does not exist.

This commit is contained in:
Dmitry Voronin 2024-02-21 04:56:09 +03:00
parent 6bc00fe38d
commit 67b1149593

View file

@ -14,6 +14,7 @@
${pkgs.git}/bin/git init ${pkgs.git}/bin/git init
${pkgs.git}/bin/git remote add origin https://git.voronind.com/voronind/linux.git ${pkgs.git}/bin/git remote add origin https://git.voronind.com/voronind/linux.git
${pkgs.git}/bin/git fetch || { ${pkgs.git}/bin/git fetch || {
echo "Dotfiles init failed, cleaning up.."
rm -rf .git rm -rf .git
exit 1 exit 1
}; };
@ -21,7 +22,7 @@
${pkgs.git}/bin/git reset --hard HEAD ${pkgs.git}/bin/git reset --hard HEAD
${pkgs.git}/bin/git checkout main ${pkgs.git}/bin/git checkout main
${pkgs.git}/bin/git branch --set-upstream-to=origin/main main ${pkgs.git}/bin/git branch --set-upstream-to=origin/main main
${pkgs.git}/bin/git branch -D master ${pkgs.git}/bin/git branch -D master || true
${pkgs.git}/bin/git clean -f ${pkgs.git}/bin/git clean -f
}; };
${pkgs.git}/bin/git pull ${pkgs.git}/bin/git pull