Skip to content
Snippets Groups Projects
Commit 6853e7cc authored by NIDABRAHIM Youssef's avatar NIDABRAHIM Youssef
Browse files

Fin TP1

parent a2977a92
No related branches found
No related tags found
No related merge requests found
......@@ -384,6 +384,7 @@ $ git commit -m "Q2.3"
```
0. Afficher un historique sous forme de graph (`a dog`) de votre repo
```
$ git log --all --graph --decorate --oneline
*71592a8 (HEAD -> reda_youssef-2.4, reda_youssef) Q2.3
......@@ -397,103 +398,106 @@ $ git commit -m "Q2.3"
```
0. Pourquoi les 2 branches pointent elles sur la même révision ?`*`
> On remarque que les 2 branches `reda_youssef` et `reda_youssef-2.4` pointent sur la même révision puisque il n'y pas de `commit`
```
$ git add .
$ git commit -m "Q2.4.2"
[reda_youssef-2.4 12bae9c] Q2.4.2
1 file changed, 186 insertions(+), 14 deletions(-)
```
$ git add .
$ git commit -m "Q2.4.2"
[reda_youssef-2.4 12bae9c] Q2.4.2
1 file changed, 186 insertions(+), 14 deletions(-)
```
0. Afficher à nouveau l'historique pour montrer les modifications suite au précédent commit `*`
```
$ git log --graph --abbrev-commit --decorate
*commit 12bae9c (HEAD -> reda_youssef-2.4)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 23:00:27 2018 +0100
|
| Q2.4.2
|
*commit 71592a8 (reda_youssef)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:21:41 2018 +0100
|
| Q2.3
|
*commit 03c3017
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:19:47 2018 +0100
|
| Q2.2
|
*commit 717b390 (master)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:14:02 2018 +0100
|
| Q1.15
:...skipping...
*commit 12bae9c (HEAD -> reda_youssef-2.4)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 23:00:27 2018 +0100
|
| Q2.4.2
|
*commit 71592a8 (reda_youssef)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:21:41 2018 +0100
|
| Q2.3
|
*commit 03c3017
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:19:47 2018 +0100
|
| Q2.2
|
*commit 717b390 (master)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:14:02 2018 +0100
|
| Q1.15
|
*commit 715a4ee
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:05:17 2018 +0100
|
| Q1.13
|
*commit 51a5add
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 21:53:17 2018 +0100
|
| Q1.10
|
*commit a38f03f
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 21:40:41 2018 +0100
|
| Q1.9
|
*commit abfd2d9
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 21:15:48 2018 +0100
|
| Q1.7
|
*commit 3ec344e
Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
Date: Mon Feb 12 21:02:43 2018 +0100
Q1.3
```
> On commite cette étape Q2.4.3
```
```
$ git log --graph --abbrev-commit --decorate
*commit 12bae9c (HEAD -> reda_youssef-2.4)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 23:00:27 2018 +0100
|
| Q2.4.2
|
*commit 71592a8 (reda_youssef)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:21:41 2018 +0100
|
| Q2.3
|
*commit 03c3017
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:19:47 2018 +0100
|
| Q2.2
|
*commit 717b390 (master)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:14:02 2018 +0100
|
| Q1.15
:...skipping...
*commit 12bae9c (HEAD -> reda_youssef-2.4)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 23:00:27 2018 +0100
|
| Q2.4.2
|
*commit 71592a8 (reda_youssef)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:21:41 2018 +0100
|
| Q2.3
|
*commit 03c3017
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:19:47 2018 +0100
|
| Q2.2
|
*commit 717b390 (master)
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:14:02 2018 +0100
|
| Q1.15
|
*commit 715a4ee
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 22:05:17 2018 +0100
|
| Q1.13
|
*commit 51a5add
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 21:53:17 2018 +0100
|
| Q1.10
|
*commit a38f03f
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 21:40:41 2018 +0100
|
| Q1.9
|
*commit abfd2d9
|Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
|Date: Mon Feb 12 21:15:48 2018 +0100
|
| Q1.7
|
*commit 3ec344e
Author: NIDABRAHIM Youssef <youssef.nidabrahim@um5s.net.ma>
Date: Mon Feb 12 21:02:43 2018 +0100
Q1.3
```
> On commite cette étape Q2.4.3
```
$ git add .
$ git commit -m "Q2.4.3"
[reda_youssef-2.4 3dd3708] Q2.4.3
1 file changed, 10 insertions(+), 11 deletions(-)
[reda_youssef-2.4 3dd3708] Q2.4.3
1 file changed, 10 insertions(+), 11 deletions(-)
```
0. Pourquoi les 2 branches pointent elles sur la même révision ?`*`
> Car il n'y a pas de changement
```
$ git add .
......@@ -503,6 +507,7 @@ $ git commit -m "Q2.3"
```
0. Afficher à nouveau l'historique pour montrer les modifications suite au précédent commit `*`
```
$ git log --graph --abbrev-commit --decorate
*commit d72c9c1 (HEAD -> reda_youssef-2.4)
......@@ -694,12 +699,14 @@ $ git commit -m "Q2.11"
##### 3. Merge
0. Merge depuis head
0. switcher sur une nouvelle branche `mybranch-3.1`
```
$ git checkout -b reda_youssef-3.1
Switched to a new branch 'reda_youssef-3.1'
```
0. ajout un nouveau fichier nommé easy_merge avec la date et l'heure actuelle `*`
```
$ touch easy_merge
$ date > easy_merge
......@@ -714,6 +721,7 @@ $ git commit -m "Q2.11"
```
0. merger la branche `mybranch-3.1` sur `mybranch`
```
$ git checkout reda_youssef
Switched to branch 'reda_youssef'
......@@ -782,6 +790,7 @@ $ git commit -m "Q3.4"
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)`*`
```
$ git merge reda_youssef-2.4
Auto-merging REDA_YOUSSEF.md
......@@ -798,6 +807,7 @@ $ git commit -m "Q3.4"
```
0. Affichez un historique sous forme de graph (`a dog`) de votre repo `*`
```
$ git log --all --graph --decorate --oneline
*04680c8 (HEAD -> reda_youssef) Q3.5.1
......@@ -835,6 +845,7 @@ $ git commit -m "Q3.4"
0. Merge avec conflit
0. Céer une nouvelle branche `mybranch-3.6`
```
$ git branch reda_youssef-3.6
Created a new branch 'reda_youssef-3.6'
......@@ -842,6 +853,7 @@ $ git commit -m "Q3.4"
```
0. Notez dans le CR la date et l'heure actuelle (avec la commande `date` par exemple) `*`
```
$ date >> REDA_YOUSSEF.md
```
......@@ -854,6 +866,7 @@ $ git commit -m "Q3.4"
```
0. Switchez sur la nouvelle branche et modifiez la réponse précendante dans le CR avec le `*`
```
$ git checkout reda_youssef_3.6
$ date >> REDA_YOUSSEF.md
......@@ -867,7 +880,7 @@ $ git commit -m "Q3.4"
```
0. Réalisez le merge de la brache `mybranch-3.6` sur `mybranch`. Le prompt change, pourquoi ? Gerer le conflit et commiter.
```
$ git checkout reda_youssef
Switched to branch 'reda_youssef'
......@@ -1009,7 +1022,20 @@ $ git commit -m "Q4.4"
$ git push origin reda_youssef
```
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, pourquoi alors que le push de toute votre branche est faite en une seule fois ?
> Avec git, les fichiers ne sont jamais tracé mais plutôt leurs modifications
> Avec git, les fichiers ne sont jamais tracé mais plutôt leurs modifications, cela veut dire que la date de modification du fichier start correspond à sa commit et non au dernier commit
0. Supprimer le dossier .git
```
$ rm -rf .git
```
0. Faire un git status ?
```
$ git status
fatal: Not a git repository (or any of the parent directories): .git
```
> **NOTE: ** C'est normal puisque le fichier `.git` a été supprimé, git ne reconnue plus notre répertoire donc il faut cloner notre branch comme suit :
```
$ git clone -b reda_youssef git@gitlab.isima.fr:mazenovi/2017-F2-Forge.git
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment