From 798f004d9245433d3829f826eafde8d8cce35a5a Mon Sep 17 00:00:00 2001 From: root Date: Thu, 4 Jan 2024 13:49:43 +0100 Subject: =?UTF-8?q?script=20ajout=20d=C3=A9p=C3=B4t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "creer-d\303\251pot-git.sh" | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 "creer-d\303\251pot-git.sh" (limited to 'creer-dépot-git.sh') diff --git "a/creer-d\303\251pot-git.sh" "b/creer-d\303\251pot-git.sh" new file mode 100755 index 0000000..b8f431f --- /dev/null +++ "b/creer-d\303\251pot-git.sh" @@ -0,0 +1,45 @@ +#!/bin/bash + +# nom du dépôt +echo "nom du dépot git:" +read depot + +# créer le dépôt vide +mkdir /home/git/"$depot" +cd /home/git/"$depot" +git init --bare +git config --global init.defaultBranch master # nommer la branche pour supprimer les avertissements +cd .. +chown -R git:git "$depot" + +# decription +echo "description du dépôt" +read description + +# ajouter le dépôt au site web cgit +echo '' >> /etc/cgitrc +echo repo.url="$depot" >> /etc/cgitrc +echo repo.path=/var/data/git/"$depot" >> /etc/cgitrc +echo repo.desc="$description" >> /etc/cgitrc + +# fin du script + + + +# ensuite, sur le client + +# méthode en clonant le dépôt vide +# git clone git@ordipolo.fr:nom-du-depot + +# => mettre les fichiers dedans + +# cd nom-du-depot +# git add * +# git commit -m nom-du-commit +# git push + + +# OU associer un dossier local au dépôt +# cd nom-du-depot +# git init +# git remote add nom-du-depot utilisateur@adresse -- cgit v1.2.3