Skip to content
Snippets Groups Projects
Commit 2dc07ae0 authored by bertoni's avatar bertoni
Browse files

modif rapport

parent f921f323
No related branches found
No related tags found
No related merge requests found
date # Cours Forge ZZ2 F2 2017
# Infos étudiant :
Par binôme Nom Prénom:
* Walczyszyn Fabien
* Bertoni Marion
## 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
git init
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\ cpw.md
0. Afficher la status de votre copie de travail
$ git status
On branch master
nothing to commit, working tree clean
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 add tp1\ cpw.md
$ git commit -m "suppression premiere partie"
[master 8ea1747] suppression premiere partie
1 file changed, 8 insertions(+), 87 deletions(-)
0. Afficher l'historique de votre repo
$ git log
commit 8ea17476335ccafecafd53a80715de71d4b13b54 (HEAD -> master)
Author: bertoni <marion_bertoni@outlook.fr>
Date: Mon Jan 8 18:30:28 2018 +0100
suppression premiere partie
commit a95c3e051181aa16b2a2e8bd95fb7c2c65a690d3
Author: bertoni <marion_bertoni@outlook.fr>
Date: Mon Jan 8 18:21:02 2018 +0100
premier ajout
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) `*`
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
renamed: tp1 cpw.md -> Bertoni Walczyszyn tp1 cpw.md
$ git commit -a --amend -m"modification du nom"
[master 4773e48] modification du nom
Date: Mon Jan 8 18:30:28 2018 +0100
1 file changed, 8 insertions(+), 87 deletions(-)
rename tp1 cpw.md => Bertoni Walczyszyn tp1 cpw.md (61%)
0. Afficher l'historique de votre repo
$ git log
commit 4773e48d22ecbca3b1d7e07ae3e6893fb1e7859b (HEAD -> master)
Author: bertoni <marion_bertoni@outlook.fr>
Date: Mon Jan 8 18:30:28 2018 +0100
modification du nom
commit a95c3e051181aa16b2a2e8bd95fb7c2c65a690d3
Author: bertoni <marion_bertoni@outlook.fr>
Date: Mon Jan 8 18:21:02 2018 +0100
premier ajout
0. Il ne devrait y avoir que deux entrées dans l'historique pourquoi ? `*`
Le deuxième commit a été modifié, un nouveau commit n'a pas été créé pour le changement
de nom du fichier.
0. Créer un nouveau fichier, nommé start, contenant la date et l'heure actuelle `*`
$ git add *
$ git commit -m "ajout fichier start"
[master 39cc64e] ajout fichier start
2 files changed, 55 insertions(+), 2 deletions(-)
create mode 100644 start.txt
0. Créer un nouveau fichier : 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)
file2ignore.txt
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 `*`
$ touch .gitignore
$ echo .gitignore > file2ignore.txt
$ git add .gitignore
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory.
$ git commit -m "ajout .gitignore"
[master b710486] ajout .gitignore
1 file changed, 1 insertion(+)
create mode 100644 .gitignore
0. Lister le contenu du repertoire courant, afficher le status et la log
$ ls -a
./ ../ .git/ .gitignore 'Bertoni Walczyszyn tp1 cpw.md' file2ignore.txt start.txt
$ 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: Bertoni Walczyszyn tp1 cpw.md
no changes added to commit (use "git add" and/or "git commit -a")
$ git log
commit 8d099642e935da8dfb10e45c15dfdeb6baf21718 (HEAD -> master)
Author: bertoni <marion_bertoni@outlook.fr>
Date: Mon Jan 8 18:53:56 2018 +0100
ajout .gitignore
commit 39cc64eb63efc636e37df435d7f4fb1c1b8a769b
Author: bertoni <marion_bertoni@outlook.fr>
Date: Mon Jan 8 18:43:46 2018 +0100
ajout fichier start
commit 4773e48d22ecbca3b1d7e07ae3e6893fb1e7859b
Author: bertoni <marion_bertoni@outlook.fr>
Date: Mon Jan 8 18:30:28 2018 +0100
modification du nom
commit a95c3e051181aa16b2a2e8bd95fb7c2c65a690d3
Author: bertoni <marion_bertoni@outlook.fr>
Date: Mon Jan 8 18:21:02 2018 +0100
premier ajout
0. Avant de commiter affichez les modifications par rapport à la précédente révision ? `*`
$ git diff HEAD 39cc64
diff --git a/Bertoni Walczyszyn tp1 cpw.md b/Bertoni Walczyszyn tp1 cpw.md
index 24d2b78..d503c57 100644
--- a/Bertoni Walczyszyn tp1 cpw.md
+++ b/Bertoni Walczyszyn tp1 cpw.md
@@ -52,12 +52,11 @@ https://gitlab.isima.fr/mazenovi/2017-F2-Forge
renamed: tp1 cpw.md -> Bertoni Walczyszyn tp1 cpw.md
-
- $ git commit -a --amend -m"modification du nom"
- [master 4773e48] modification du nom
- Date: Mon Jan 8 18:30:28 2018 +0100
- 1 file changed, 8 insertions(+), 87 deletions(-)
- rename tp1 cpw.md => Bertoni Walczyszyn tp1 cpw.md (61%)
+ $ git commit -a --amend -m"modification du nom"
+ [master 4773e48] modification du nom
+ Date: Mon Jan 8 18:30:28 2018 +0100
+ 1 file changed, 8 insertions(+), 87 deletions(-)
+ rename tp1 cpw.md => Bertoni Walczyszyn tp1 cpw.md (61%)
0. Afficher l'historique de votre repo
@@ -80,12 +79,81 @@ https://gitlab.isima.fr/mazenovi/2017-F2-Forge
de nom du fichier.
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index eb0899c..0000000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-file2ignore.txt
##### 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`)
$ git branch BertoniWalczyszyn
0. Lister les branches locales et les fichiers présent dans le répertoire courant `*`
$ git branch
BertoniWalczyszyn
* master
$ ls -a
./ ../ .git/ .gitignore 'Bertoni Walczyszyn tp1 cpw.md' file2ignore.txt start.txt
0. Aficher le status de votre repo `*`
$ git status
On branch master
nothing to commit, working tree clean
0. Créez une branche pour _développer_ la réponse de ce point (nommez là `mybranch-2.4` par exemple)
$ git branch
BW-2.4
BertoniWalczyszyn
* master
0. Afficher un historique sous forme de graph (`a dog`) de votre repo
$ git log --all --decorate --oneline --graphhh
* 88533e1 (BertoniWalczyszyn) derniere version
* 113376e (origin/BertoniWalczyszyn) derniere version 08/01
| * 52f744d (HEAD -> BW-2.4, master) 19h32
| * ae1b0d7 branche créée
|/
* 8d09964 ajout .gitignore
* 39cc64e ajout fichier start
* 4773e48 modification du nom
* a95c3e0 premier ajout
0. Pourquoi les 2 branches pointent elles sur la même révision ?`*`
Car aucune modification n'a encore été faite, aucun nouveau commit sur la nouvelle branche
0. Afficher à nouveau l'historique pour montrer les modifications suite au précédent commit `*`
$ git log --all --decorate --oneline --graph
* baf3847 (HEAD -> BW-2.4) creation branche BW-2.4
* 52f744d (master) 19h32
* ae1b0d7 branche créée
| * 88533e1 (BertoniWalczyszyn) derniere version
| * 113376e (origin/BertoniWalczyszyn) derniere version 08/01
|/
* 8d09964 ajout .gitignore
* 39cc64e ajout fichier start
* 4773e48 modification du nom
* a95c3e0 premier ajout
0. Revenir la branche `mybranch`
$ git checkout BertoniWalczyszyn
Switched to branch 'BertoniWalczyszyn'
0. Où sont passées vos reponses au point 2.4 ? `*`
elles ont disparu
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)
$ git commit -m "ajout new_file"
[master 5b03c92] ajout new_file
2 files changed, 60 insertions(+), 6 deletions(-)
create mode 100644 new_file
0. Revenir sur votre branche `mybranch` pour completer le compte rendu `*`
$ git checkout BertoniWalczyszyn
Switched to branch 'BertoniWalczyszyn'
0. Affichez un historique sous forme de graph (`a dog`) de votre repo `*`
$ git log --all --decorate --oneline --graph
* 5b03c92 (master) ajout new_file
| * 8e5667f (HEAD -> BertoniWalczyszyn) changement de branche
| * 65e4aff mise a jour rapport
| |\
| | * 52d300a (BW-2.4) changement de branche
| | * baf3847 creation branche BW-2.4
| |/
|/|
* | 52f744d 19h32
* | ae1b0d7 branche créée
| * 88533e1 derniere version
| * 113376e (origin/BertoniWalczyszyn) derniere version 08/01
|/
* 8d09964 ajout .gitignore
* 39cc64e ajout fichier start
* 4773e48 modification du nom
* a95c3e0 premier ajout
##### 3. Merge
0. Merge depuis head
0. switcher sur une nouvelle branche `mybranch-3.1`
$ git branch BW-3.1
$ git checkout BW-3.1
Switched to branch 'BW-3.1'
0. ajout un nouveau fichier nommé easy_merge avec la date et l'heure actuelle `*`
touch easy_merge.txt
echo "05/02/2018 18:06"> easy_merge.txt
$ git commit -m "ajout fichier easy_merge.txt"
[BW-3.1 3dd77e5] ajout fichier easy_merge.txt
1 file changed, 1 insertion(+)
create mode 100644 easy_merge.txt
0. merger la branche `mybranch-4.1` sur `mybranch`
$ git checkout master
Switched to branch 'master'
$ git merge BW-3.1
Auto-merging Bertoni Walczyszyn tp1 cpw.md
CONFLICT (content): Merge conflict in Bertoni Walczyszyn tp1 cpw.md
Automatic merge failed; fix conflicts and then commit the result.
0. Afficher le status
$ git status
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Changes to be committed:
new file: easy_merge.txt
0. Pourquoi n'y a t'il aucune modification en cours ? `*`
Car tous les nouveaux fichiers ont été ajouter dans la branche 3.1 et un merge a été fait donc il ne sont plus a faire dans la branche master
0. Affichez un historique sous forme de graph (`a dog`) de votre repo et décire l'état courant`*`
```
$ git log --all --decorate --oneline --graph
* a88b6c0 (HEAD -> master) après merge avec BW-3.1
|\
| * bc42d8f (BW-3.1) changement de branche
| * 3dd77e5 ajout fichier easy_merge.txt
| * 9e1a11d (origin/BertoniWalczyszyn, BertoniWalczyszyn) dernier version 29/01
| * 8e5667f changement de branche
| * 65e4aff mise a jour rapport
| |\
| | * 52d300a (BW-2.4) changement de branche
| | * baf3847 creation branche BW-2.4
| * | 88533e1 derniere version
| * | 113376e derniere version 08/01
* | | 5b03c92 ajout new_file
| |/
|/|
* | 52f744d 19h32
* | ae1b0d7 branche créée
|/
* 8d09964 ajout .gitignore
* 39cc64e ajout fichier start
* 4773e48 modification du nom
* a95c3e0 premier ajout
La branche master est dans le même etat que la branche BW-3.1 puisque un merge a été fait (même si un commit a été fait pour ajouter les changement dans le rapport)
```
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 BW-2.4
Merge made by the 'recursive' strategy.
start.txt | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
0. Affichez un historique sous forme de graph (`a dog`) de votre repo `*`
```
* 51e7d1d (BW-3.6) gerge branch 'BW-2.4' into BertoniWalczyszyn
|\
| * b2b020d (BW-2.4) modif start.txt
| | * a88b6c0 (HEAD -> master) après merge avec BW-3.1
| | |\
| | | * bc42d8f (BW-3.1) changement de branche
| | | * 3dd77e5 ajout fichier easy_merge.txt
| |_|/
|/| |
* | | 9e1a11d (origin/BertoniWalczyszyn) dernier version 29/01
* | | 8e5667f changement de branche
* | | 65e4aff mise a jour rapport
|\ \ \
| |/ /
| * | 52d300a changement de branche
| * | baf3847 creation branche BW-2.4
* | | 88533e1 derniere version
* | | 113376e derniere version 08/01
| | * 5b03c92 ajout new_file
| |/
| * 52f744d 19h32
| * ae1b0d7 branche créée
|/
* 8d09964 ajout .gitignore
* 39cc64e ajout fichier start
* 4773e48 modification du nom
* a95c3e0 premier ajout
```
0. Merge avec conflit
0. Céer une nouvelle branche `mybranch-3.6`
$ git branch BW-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 `*`
$ git remote add origin https://mabertoni1@gitlab.isima.fr/mazenovi/2017-F2-Forge.git
0. Lister les branches distantes
0. Pousser votre branche de votre repo local sur le repos distant `*`
$ git push origin BertoniWalczyszyn
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (13/13), 4.63 KiB | 592.00 KiB/s, done.
Total 13 (delta 2), reused 0 (delta 0)
remote:
remote: To create a merge request for BertoniWalczyszyn, visit:
remote: https://gitlab.isima.fr/mazenovi/2017-F2-Forge/merge_requests/new?merge_request%5Bsource_branch%5D=BertoniWalczyszyn
remote:
To https://gitlab.isima.fr/mazenovi/2017-F2-Forge.git
* [new branch] BertoniWalczyszyn -> BertoniWalczyszyn
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 ?
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