|
|
|
@@ -159,18 +159,67 @@ CHECKOUT
|
|
|
|
|
Changer de branche
|
|
|
|
|
TUTO https://git-scm.com/book/fr/v2/Les-branches-avec-Git-Gestion-des-branches
|
|
|
|
|
|
|
|
|
|
Etat des fichiers :
|
|
|
|
|
> git status
|
|
|
|
|
|
|
|
|
|
Ajouter un fichier (ou tous *)
|
|
|
|
|
> git add ./README.md
|
|
|
|
|
> git add *
|
|
|
|
|
|
|
|
|
|
Etat des fichiers :
|
|
|
|
|
> git status
|
|
|
|
|
Git commit
|
|
|
|
|
> git commit
|
|
|
|
|
... on écrit les modifications apportées dans le navigateur text
|
|
|
|
|
... on peut installer nano https://command-not-found.com/nano
|
|
|
|
|
... ou utiliser vim...
|
|
|
|
|
.... on tappe -- ESCAPE + ":a" pour rendrer en mod édition
|
|
|
|
|
.... on quitte+save en tappant -- ESCAPE + ":wq"
|
|
|
|
|
.... on quitte no_save tappant -- ESCAPE + ":q!"
|
|
|
|
|
/OU/ directement depuis la commmande
|
|
|
|
|
> git commit -m 'initial commit of my project'
|
|
|
|
|
|
|
|
|
|
Visualiser les modifications :
|
|
|
|
|
> git log -p -2
|
|
|
|
|
> git log --pretty=oneline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
voir l'historique
|
|
|
|
|
> git log --pretty=format:"%h %s" --graph
|
|
|
|
|
|
|
|
|
|
annuler un ajout sur un fichier
|
|
|
|
|
> git checkout -- CONTRIBUTING.md
|
|
|
|
|
restaure
|
|
|
|
|
> git restore --staged CONTRIBUTING.md
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BRANCHES
|
|
|
|
|
TUTO : https://git-scm.com/book/fr/v2/Les-branches-avec-Git-Les-branches-en-bref
|
|
|
|
|
|
|
|
|
|
voir les branches ( locales + distantes )
|
|
|
|
|
> git branch --all
|
|
|
|
|
|
|
|
|
|
voir l'historique
|
|
|
|
|
> git log --pretty=format:"%h %s" --graph
|
|
|
|
|
changer (basculer de branche)
|
|
|
|
|
> git checkout -b forkit
|
|
|
|
|
|
|
|
|
|
revenir/changer à la branche d'origine "main" (ou "forkit")
|
|
|
|
|
> git checkout main
|
|
|
|
|
> git checkout forkit
|
|
|
|
|
|
|
|
|
|
envoyer les modifications à une branche spécifique
|
|
|
|
|
> git push --set-upstream origin main
|
|
|
|
|
|
|
|
|
|
merge
|
|
|
|
|
> git merge forkit
|
|
|
|
|
|
|
|
|
|
gestion de conflit de versions
|
|
|
|
|
TUTO :
|
|
|
|
|
- https://git-scm.com/book/fr/v2/Les-branches-avec-Git-Branches-et-fusions%C2%A0:-les-bases#s_basic_merging
|
|
|
|
|
> git status
|
|
|
|
|
> git mergetool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|