Forge GitLab de l'IN2P3
Version 35 (Samantha Saidi, 14/04/2017 15:07)
1 | 1 | Samantha Saidi | h1. Forge GitLab de l'IN2P3 |
---|---|---|---|
2 | 1 | Samantha Saidi | |
3 | 1 | Samantha Saidi | h2. Forge GitLab de l'IN2P3 |
4 | 1 | Samantha Saidi | |
5 | 1 | Samantha Saidi | > aller sur https://gitlab.in2p3.fr/users/sign_in |
6 | 1 | Samantha Saidi | |
7 | 1 | Samantha Saidi | > cliquer en bas à droite sur sign in with "Shibboleth" |
8 | 1 | Samantha Saidi | |
9 | 10 | Samantha Saidi | > !http://forge.cbp.ens-lyon.fr/redmine/attachments/download/1824/seconnecter.png! |
10 | 1 | Samantha Saidi | |
11 | 1 | Samantha Saidi | > entrer son login /mot de passe habituel de son université (ex. ENS de Lyon) |
12 | 1 | Samantha Saidi | |
13 | 10 | Samantha Saidi | |
14 | 22 | Samantha Saidi | h3. Créer un dépôt distant sur GitLab, et le lier à un dépôt local |
15 | 1 | Samantha Saidi | |
16 | 15 | Samantha Saidi | Clef SSH : |
17 | 15 | Samantha Saidi | |
18 | 20 | Samantha Saidi | > Créer une clef ssh un mot de passe ou une clef ssh sur son ordinateur (cf. "documentation du gitLab pas à pas":https://gitlab.in2p3.fr/cc-in2p3-atelier-git/enonce/blob/master/prerequis.md) |
19 | 1 | Samantha Saidi | |
20 | 15 | Samantha Saidi | Projet : |
21 | 15 | Samantha Saidi | |
22 | 3 | Samantha Saidi | > Créer un projet sur gitLab, par exemple umr-triangle (nom du groupe) / monprojet (nom du projet) |
23 | 1 | Samantha Saidi | |
24 | 21 | Samantha Saidi | > Copier l'url du dépôt proposé : <pre>git@gitlab.in2p3.fr:umr-triangle/monprojet.git</pre> |
25 | 2 | Samantha Saidi | |
26 | 15 | Samantha Saidi | En local, préparation du clone : |
27 | 15 | Samantha Saidi | |
28 | 24 | Samantha Saidi | > Définir un dossier de récupération du dépôt sur son ordi : par exemple : /Users/ssaidi/Documents/site-web/depot-gitlab/ |
29 | 1 | Samantha Saidi | |
30 | 25 | Samantha Saidi | > Ouvrir un terminal pour aller dans ce dossier : |
31 | 1 | Samantha Saidi | |
32 | 1 | Samantha Saidi | > <pre>cd /Users/ssaidi/Documents/site-web/depot-gitlab</pre> |
33 | 19 | Samantha Saidi | |
34 | 30 | Samantha Saidi | > Y cloner le dépôt distant |
35 | 22 | Samantha Saidi | |
36 | 2 | Samantha Saidi | > <pre>git clone git@gitlab.in2p3.fr:umr-triangle/monprojet.git</pre> |
37 | 1 | Samantha Saidi | |
38 | 30 | Samantha Saidi | (cette opération créera localement un dossier "monprojet" avec son contenu –ou vide s'il vient d'être créé sur gitlab–) |
39 | 30 | Samantha Saidi | |
40 | 30 | Samantha Saidi | h3. Travailler sur le clone (le dépôt local) |
41 | 30 | Samantha Saidi | |
42 | 27 | Samantha Saidi | > Via mon explorateur de fichier je me déplace vers le dossier créé par le clone du projet distant en local : modifier des fichiers récupérés ou "peupler" le dossier de fichiers dont je souhaite faire un dépôt : |
43 | 22 | Samantha Saidi | |
44 | 32 | Samantha Saidi | h3. Charger les fichiers vers la zone d'index, le dépôt local, puis vers le dépôt distant : |
45 | 1 | Samantha Saidi | |
46 | 32 | Samantha Saidi | > Dans le terminal je me déplace vers le dossier créé par le clone du projet distant en local : |
47 | 1 | Samantha Saidi | |
48 | 32 | Samantha Saidi | > <pre>cd monprojet</pre> |
49 | 3 | Samantha Saidi | |
50 | 3 | Samantha Saidi | > Je vérifie le statut de mon dépôt : |
51 | 3 | Samantha Saidi | |
52 | 1 | Samantha Saidi | > <pre>git status</pre> |
53 | 1 | Samantha Saidi | |
54 | 34 | Samantha Saidi | > Je charge tous mes ajouts ou modifs pour la zone d'index (tout ce qui est nouveau dans le dépôt sera repéré automatiquement par les commandes git) : |
55 | 3 | Samantha Saidi | |
56 | 1 | Samantha Saidi | > <pre>git add --all</pre> |
57 | 1 | Samantha Saidi | |
58 | 16 | Samantha Saidi | > Je les balance sur mon dépôt git local : |
59 | 3 | Samantha Saidi | |
60 | 1 | Samantha Saidi | > <pre>git commit -m"ajout initial des dossiers"</pre> |
61 | 3 | Samantha Saidi | |
62 | 1 | Samantha Saidi | > Je les balance sur mon dépôt git distant : |
63 | 1 | Samantha Saidi | |
64 | 4 | Samantha Saidi | > <pre>git push</pre> |
65 | 4 | Samantha Saidi | |
66 | 23 | Samantha Saidi | h3. Récupérer des modifs présentes sur le dépôt distant : |
67 | 1 | Samantha Saidi | |
68 | 1 | Samantha Saidi | > <pre>git pull git@gitlab.in2p3.fr:umr-triangle/monprojet.git</pre> |
69 | 23 | Samantha Saidi | |
70 | 23 | Samantha Saidi | Pour bien comprendre la différence entre add, commit et push cf. graphique : |
71 | 23 | Samantha Saidi | !http://forge.cbp.ens-lyon.fr/redmine/attachments/download/1826/git-worflow.png! |