diff options
| author | root <root@ordipolo.fr> | 2024-01-04 13:49:43 +0100 |
|---|---|---|
| committer | root <root@ordipolo.fr> | 2024-01-04 13:49:43 +0100 |
| commit | 798f004d9245433d3829f826eafde8d8cce35a5a (patch) | |
| tree | a551e0f602ab72fbb45aadcd8ac05c7d4c506ade | |
| parent | b49b36d28077b60a85f8c974b9ed34625f76298b (diff) | |
| download | tuto_git-798f004d9245433d3829f826eafde8d8cce35a5a.tar.gz tuto_git-798f004d9245433d3829f826eafde8d8cce35a5a.tar.bz2 tuto_git-798f004d9245433d3829f826eafde8d8cce35a5a.zip | |
script ajout dépôt
| -rwxr-xr-x | creer-dépot-git.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/creer-dépot-git.sh b/creer-dépot-git.sh new file mode 100755 index 0000000..b8f431f --- /dev/null +++ b/creer-dépot-git.sh | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # nom du dépôt | ||
| 4 | echo "nom du dépot git:" | ||
| 5 | read depot | ||
| 6 | |||
| 7 | # créer le dépôt vide | ||
| 8 | mkdir /home/git/"$depot" | ||
| 9 | cd /home/git/"$depot" | ||
| 10 | git init --bare | ||
| 11 | git config --global init.defaultBranch master # nommer la branche pour supprimer les avertissements | ||
| 12 | cd .. | ||
| 13 | chown -R git:git "$depot" | ||
| 14 | |||
| 15 | # decription | ||
| 16 | echo "description du dépôt" | ||
| 17 | read description | ||
| 18 | |||
| 19 | # ajouter le dépôt au site web cgit | ||
| 20 | echo '' >> /etc/cgitrc | ||
| 21 | echo repo.url="$depot" >> /etc/cgitrc | ||
| 22 | echo repo.path=/var/data/git/"$depot" >> /etc/cgitrc | ||
| 23 | echo repo.desc="$description" >> /etc/cgitrc | ||
| 24 | |||
| 25 | # fin du script | ||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | # ensuite, sur le client | ||
| 30 | |||
| 31 | # méthode en clonant le dépôt vide | ||
| 32 | # git clone git@ordipolo.fr:nom-du-depot | ||
| 33 | |||
| 34 | # => mettre les fichiers dedans | ||
| 35 | |||
| 36 | # cd nom-du-depot | ||
| 37 | # git add * | ||
| 38 | # git commit -m nom-du-commit | ||
| 39 | # git push | ||
| 40 | |||
| 41 | |||
| 42 | # OU associer un dossier local au dépôt | ||
| 43 | # cd nom-du-depot | ||
| 44 | # git init | ||
| 45 | # git remote add nom-du-depot utilisateur@adresse | ||
