terminal-save
echo
echo "Initialisation de GIT"
cd $projectDestPath
if [ "$projectGitLevel" = "1" ]; then
cd $projectTheme
fi
git remote set-url origin $projectGit
git fetch origin || {
echo
echo "Erreur d'accès à Gitlab $projectGit"
echo "Demandez un accès au projet !"
echo
exit 1
}
# checkout to default branch
git checkout $(git remote show origin | sed -n '/HEAD/s/.*: //p')
git clean -fd
# install submodules
git submodule update --init --recursive
# disable chmod file changes
git config --global core.fileMode false
git config core.fileMode false
# activate rerere https://git-scm.com/book/fr/v2/Utilitaires-Git-Rerere
git config --global rerere.enabled true
git config rerere.enabled true
terminal-restore
echo -e " + GIT \e[1;92mInitialisé\e[0m"