Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# Cours Forge ZZ2 F2 2017
# Infos étudiant :
* BOUHANNI Hamza
* EL MKOUDI Anass
## TP 1
Télécharger le sujet du TP à l'adresse suivante :
https://gitlab.isima.fr/mazenovi/2017-F2-Forge
#### 1. Les basiques
0. Créer un repository git
$mkdir myRepo
$ cd myRepo/
$ git init
Initialized empty Git repository in H:/TPs/gdp/myRepo/.git/
0. _Par la suite pensez à commiter votre compte rendu apres chaques étapes dont l'enoncé est terminé par `*`, pour les messages de commit vous pouvez utiliser les numéros des questions (Ex Q1.2 ici)_
0. Ajouter le compte rendu dans le repo `*`
$ git add tp1.md
$ git commit -m "ajout de l enonce du TP1"
[master (root-commit) 7796961] ajout de l enonce du TP1
Committer: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 158 insertions(+)
create mode 100644 tp1.md
0. Afficher la status de votre copie de travail
$ git status
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: tp1.md
no changes added to commit (use "git add" and/or "git commit -a")
0. Modifiez le CR pour supprimer la première partie et indiquez vos noms (n'oublier pas de faire un `git add` pour marque le fichier comme devant être ajouté) `*`
$ git commit -m "Q5 MAJ-CR"
[master 8e9b215] Q5 MAJ-CR
Committer: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 41 insertions(+), 80 deletions(-)
0. Afficher l'historique de votre repo
$ git log
commit 8e9b2157b67076d62c0143692f30d0ca28d1ab65 (HEAD -> master)
Author: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Date: Mon Jan 8 18:32:51 2018 +0100
Q5 MAJ-CR
commit 7796961e8665c25caadcac3abb22e04f6b8b39ef
Author: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Date: Mon Jan 8 18:19:44 2018 +0100
ajout de l enonce du TP1
0. Renommer ce fichier en préfixant avec vos noms en amendant le commit précédent (`git commit -m "mon message"` pour indiquer le mesage de commit directement) `*`
anelmkoudi@A210PC07 MINGW64 /h/TPs/gdp/myRepo (master)
$ mv tp1.md bouhanni_elmkoudi.md
anelmkoudi@A210PC07 MINGW64 /h/TPs/gdp/myRepo (master)
$ git commit -am " Q 6 renommage du fichier"
[master 081c108] Q 6 renommage du fichier
Committer: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 119 deletions(-)
delete mode 100644 tp1.md
$ mv bouhanni_elmkoudi.md bhn_mkd.md
anelmkoudi@A210PC07 MINGW64 /h/TPs/gdp/myRepo (master)
$ git commit --amend -am " Q 6 deuxieme renommage du fichier"
[master e9b6f78] Q 6 deuxieme renommage du fichier
Date: Mon Jan 8 18:38:25 2018 +0100
Committer: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 119 deletions(-)
delete mode 100644 tp1.md
anelmkoudi@A210PC07 MINGW64 /h/TPs/gdp/myRepo (master)
0. Afficher l'historique de votre repo
$ git log
commit e9b6f7847a65f10f689a409023dcc1ae22084995 (HEAD -> master)
Author: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Date: Mon Jan 8 18:38:25 2018 +0100
Q 6 deuxieme renommage du fichier
commit 8e9b2157b67076d62c0143692f30d0ca28d1ab65
Author: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Date: Mon Jan 8 18:32:51 2018 +0100
Q5 MAJ-CR
commit 7796961e8665c25caadcac3abb22e04f6b8b39ef
Author: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Date: Mon Jan 8 18:19:44 2018 +0100
ajout de l enonce du TP1
0. Il ne devrait y avoir que deux entrées dans l'historique pourquoi ? `*`
on a ecrase le troisieme commit en utilisant l'option --amend.
0. Créer un nouveau fichier, nommé start, contenant la date et l'heure actuelle `*`
$ touch start.txt
$ echo "$(date)" > start.txt
$ git add start.txt
warning: LF will be replaced by CRLF in start.txt.
The file will have its original line endings in your working directory.
anelmkoudi@A210PC07 MINGW64 /h/TPs/gdp/myRepo (master)
$ git commit -m "Q10 ajout du fichier start"
[master bcd3b94] Q10 ajout du fichier start
Committer: EL MKOUDI Anass <anelmkoudi@rcisima.isima.fr>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 1 insertion(+)
create mode 100644 start.txt
0. Créer un nouveau fichier : file2ignore
$touch file2ignore
0. Afficher la status de votre copie de travail
$ git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
bhn_mkd.md
file2ignore
nothing added to commit but untracked files present (use "git add" to track)
0. On souhaite que ce fichier soit ignoré et ne soit jamais commiter. Réalisez la configuration nécesaire pour que cette regle soit effective `*`
0. Lister le contenu du repertoire courant, afficher le status et la log
0. Avant de commiter affichez les modifications par rapport à la précédente révision ? `*`
##### 2. Les branches
0. Créez une branche portant votre nom et basculer sur cette branche (dans la suite du TP cette branche est désignée par `mybranch`)
0. Lister les branches locales et les fichiers présent dans le répertoire courant `*`
0. Aficher le status de votre repo `*`
0. Créez une branche pour _développer_ la réponse de ce point (nommez là `mybranch-2.4` par exemple)
0. Afficher un historique sous forme de graph (`a dog`) de votre repo
0. Pourquoi les 2 branches pointent elles sur la même révision ?`*`
0. Afficher à nouvea l'historique pour montrer les modifications suite au précédent commit `*`
0. Revenir la brache `mybranch`
0. Où sont passé vos reponces au point 2.4 ? `*`
0. Affichez un historique sous forme de graph (`a dog`) de votre repo, Que peux ton en dire ?
0. Revenir sur la branche master
0. Ajoutez et commitez un fichier (touch new_file)
0. Revenir sur votre branche `mybranch` pour completer le compte rendu `*`
0. Affichez un historique sous forme de graph (`a dog`) de votre repo `*`
##### 3. Merge
0. Merge depuis head
0. switcher sur une nouvelle branche `mybranch-3.1`
0. ajout un nouveau fichier nommé easy_merge avec la date et l'heure actuelle `*`
0. merger la branche `mybranch-4.1` sur `mybranch`
0. Afficher le status
0. Pourquoi n'y a t'il aucune modification en cours ? `*`
0. Affichez un historique sous forme de graph (`a dog`) de votre repo et décire l'état courant`*`
0. Merge avec modifications
0. Mergez les modifications de la branche `mybranch-2.4` sur `mybranch` (`*echap* :wq *enter*` pour sauvegarder le message de commit et quitter)`*`
0. Affichez un historique sous forme de graph (`a dog`) de votre repo `*`
0. Merge avec conflit
0. Céer une nouvelle branche `mybranch-3.6`
0. Notez dans le CR la date et l'heure actuelle (avec la commande `date` par exemple) `*`
0. Switchez sur la nouvelle branche et modifiez la réponse précendante dans le CR avec le `*`
0. Réalisez le merge de la brache `mybranch-3.6` sur `mybranch`. Le prompt change, pourquoi ? Gerer le conflit et commiter.
0. Supprimer les branches de feature et afficher toutes les branches restantes, affichez un historique sous forme de graph (`a dog`) de votre repo `*`
##### 4. Remote
0. Afficher l'historique de votre repo
0. Ajouter le projet "2017-F2-Forge" comme repository distant `*`
0. Lister les branches distantes
0. Pousser votre branche de votre repo local sur le repos distant `*`
0. En consultant votre branche sous gitlab, vous devriez constaté que la date de modification du fichier start est plus acienne que celle de votre compte rendu, porquoi alors que le push de toute votre branche est faite en une seule fois ?
0. Supprimer le dossier .git
0. Faire un git status ?