mirror of
https://gitlab.com/bonnebulle/plain-html-redo.git
synced 2025-12-06 10:08:45 +01:00
TUTO Titles, cl
This commit is contained in:
140
README.md
140
README.md
@@ -1,3 +1,7 @@
|
|||||||
|
|
||||||
|
# Accéder au projet :
|
||||||
|
- https://USERNAME.gitlab.io/PROJECT_NAME
|
||||||
|
=>
|
||||||
L'URL FINALE == https://bonnebulle.gitlab.io/plain-html-redo
|
L'URL FINALE == https://bonnebulle.gitlab.io/plain-html-redo
|
||||||
Redirige vers = https://plain-html-redo-751743.gitlab.io
|
Redirige vers = https://plain-html-redo-751743.gitlab.io
|
||||||
( URL Non personelle )
|
( URL Non personelle )
|
||||||
@@ -6,9 +10,9 @@ hébergement gratuit !
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Tuto :
|
# Tuto :
|
||||||
|
|
||||||
Objectif :
|
## Objectif :
|
||||||
Cloner un projet initial existant
|
Cloner un projet initial existant
|
||||||
( "> git clone +url" )
|
( "> git clone +url" )
|
||||||
Comprendre le versionning + fork
|
Comprendre le versionning + fork
|
||||||
@@ -19,14 +23,18 @@ Auto-héberger une page sur GitLab
|
|||||||
( gratuit )
|
( gratuit )
|
||||||
|
|
||||||
|
|
||||||
Éditer du code ...
|
## Éditer du code ...
|
||||||
Le partager et envoyer les dernières modifications :
|
Le partager et envoyer les dernières modifications :
|
||||||
GITLAB permet de travailler sans rien installer !
|
GITLAB permet de travailler sans rien installer !
|
||||||
Il embarque un IDE (éditeur de code accessible en ligne )
|
Il embarque un IDE ( éditeur de code accessible en ligne )
|
||||||
On va travailler à partir de cet interface web
|
On va travailler à partir de cet interface web
|
||||||
|
mais on peut aussi l'installer "en local" :
|
||||||
|
|
||||||
.... mais on peut aussi...
|
|
||||||
INSTALLER EN LOCAL :
|
|
||||||
|
|
||||||
|
|
||||||
|
# INSTALLER EN LOCAL :
|
||||||
|
|
||||||
+ VSCODE / CODIUM :
|
+ VSCODE / CODIUM :
|
||||||
? https://alternativeto.net/software/codium/
|
? https://alternativeto.net/software/codium/
|
||||||
@@ -41,9 +49,8 @@ https://www.it-connect.fr/tuto-changer-langue-visual-studio-code-francais-anglai
|
|||||||
https://www.jetbrains.com/webstorm/
|
https://www.jetbrains.com/webstorm/
|
||||||
|
|
||||||
|
|
||||||
MAIS AUSSI :
|
## Terminal
|
||||||
|
|
||||||
+ Terminal :
|
|
||||||
( utiliser la ligne de commande )
|
( utiliser la ligne de commande )
|
||||||
https://openclassrooms.com/fr/courses/6173491-apprenez-a-utiliser-la-ligne-de-commande-dans-un-terminal/6349461-decouvrez-le-terminal#r-6349452
|
https://openclassrooms.com/fr/courses/6173491-apprenez-a-utiliser-la-ligne-de-commande-dans-un-terminal/6349461-decouvrez-le-terminal#r-6349452
|
||||||
|
|
||||||
@@ -51,7 +58,7 @@ https://openclassrooms.com/fr/courses/6173491-apprenez-a-utiliser-la-ligne-de-co
|
|||||||
https://coolguy.website/map-is-the-territory/introduction.html
|
https://coolguy.website/map-is-the-territory/introduction.html
|
||||||
|
|
||||||
|
|
||||||
+ Git :
|
## Git :
|
||||||
https://git-scm.com/downloads
|
https://git-scm.com/downloads
|
||||||
|
|
||||||
Vérifier via Terminal
|
Vérifier via Terminal
|
||||||
@@ -60,12 +67,19 @@ Vérifier via Terminal
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
CREER UN COMPTE GITlab
|
|
||||||
|
# En ligne sur GitLab/Hub
|
||||||
|
|
||||||
|
CREER UN COMPTE GItLab/Hub
|
||||||
https://gitlab.com/users/sign_up
|
https://gitlab.com/users/sign_up
|
||||||
|
|
||||||
|
|
||||||
|
## TOKEN
|
||||||
|
|
||||||
On aurra aussi besoin d'un Token d'accès....
|
On aurra aussi besoin d'un Token d'accès....
|
||||||
Un code long qui donne certaines autorisations ( par exemple pour pull/push/commit, etc )
|
Un code long qui donne certaines autorisations ( par exemple pour pull/push/commit, etc )
|
||||||
---> TOKEN
|
|
||||||
|
DO ....
|
||||||
PAGE du PROJET -> GAUCHE
|
PAGE du PROJET -> GAUCHE
|
||||||
-> Settings > Access Token
|
-> Settings > Access Token
|
||||||
--> Add New Token (boutton gris)
|
--> Add New Token (boutton gris)
|
||||||
@@ -81,10 +95,12 @@ Vérfier / Révoquer les acces :
|
|||||||
|
|
||||||
. . .
|
. . .
|
||||||
|
|
||||||
FORK PROJET
|
|
||||||
|
# FORK PROJET
|
||||||
PAGE d'exemple :
|
PAGE d'exemple :
|
||||||
https://gitlab.com/pages/plain-html
|
https://gitlab.com/pages/plain-html
|
||||||
|
|
||||||
|
DO ....
|
||||||
On clic "Fork"
|
On clic "Fork"
|
||||||
--> Cela va copier le projet existant dans tes projets sur les serveurs de GitLab/Hub
|
--> Cela va copier le projet existant dans tes projets sur les serveurs de GitLab/Hub
|
||||||
--> Et tu pourras alors modifier cette version (copie) en toute libertée
|
--> Et tu pourras alors modifier cette version (copie) en toute libertée
|
||||||
@@ -94,6 +110,7 @@ EX/ https://gitlab.com/bonnebulle/plain-html-redo
|
|||||||
|
|
||||||
. . .
|
. . .
|
||||||
|
|
||||||
|
# METTRE EN LIGNE
|
||||||
Pour rendre le projet accessible en ligne, hébergé par GitLab/Hub...
|
Pour rendre le projet accessible en ligne, hébergé par GitLab/Hub...
|
||||||
"Transformer" en PAGE :
|
"Transformer" en PAGE :
|
||||||
Dans le projet actuel ->
|
Dans le projet actuel ->
|
||||||
@@ -107,15 +124,48 @@ PAGE URL ==
|
|||||||
|
|
||||||
. . .
|
. . .
|
||||||
|
|
||||||
|
# OUVRIR ou CLONER
|
||||||
|
|
||||||
|
DO ....
|
||||||
RETOUR AU PROJET
|
RETOUR AU PROJET
|
||||||
--> Code (boutton bleu)
|
--> Code (boutton bleu)
|
||||||
--> Ouvrir avec....
|
--> Ouvrir avec....
|
||||||
---> Va ouvrir un IDE...
|
---> Va ouvrir un IDE...
|
||||||
|
|
||||||
|
- Cloner le projet en entier (travailler en local)
|
||||||
/SI/ on veut cloner+ouvrir le projet en local...
|
/SI/ on veut cloner+ouvrir le projet en local...
|
||||||
( avec vscode/codium/IDE installé sur l'ordinateur )
|
( avec vscode/codium/IDE installé sur l'ordinateur )
|
||||||
Gitlab va proposer de clonner le projet avant de l'ouvrir avec ....
|
Gitlab va proposer de clonner le projet avant de l'ouvrir avec ....
|
||||||
|
|
||||||
|
|
||||||
|
- On peut également cloner le projet depuis le terminal avec :
|
||||||
|
/SI/ on veut le faire manuellement
|
||||||
|
DO ....
|
||||||
|
RETOUR AU PROJET
|
||||||
|
--> Code (boutton bleu)
|
||||||
|
--> Clone with HTTPS (copy https.....monprojet.git)
|
||||||
|
Dans le terminal aller dans un dossier ou télécharger le projet
|
||||||
|
. . .
|
||||||
|
Chemin actuel
|
||||||
|
> pwd
|
||||||
|
Se déplacer cd
|
||||||
|
EX dossier actuel/ ./(+press TABULATION)
|
||||||
|
EX dossier parent/ ../(+press TABULATION)
|
||||||
|
> cd ./
|
||||||
|
> cd ../
|
||||||
|
|
||||||
|
Une fois dans le bon dossier (au choix)
|
||||||
|
> git clone https....monprojet.git
|
||||||
|
lister fichiers clonés
|
||||||
|
> ls
|
||||||
|
--> dossier du projet
|
||||||
|
--> on va dedans
|
||||||
|
> cd monprojet
|
||||||
|
> ls
|
||||||
|
Localiser le chemin du dossier actuel
|
||||||
|
> pwd
|
||||||
|
|
||||||
|
- Ouvir 1 fichier... en ligne sur l'IDE embarquée de GitLab...
|
||||||
/SI/ on veut travailler en ligne (IDE GitLab)...
|
/SI/ on veut travailler en ligne (IDE GitLab)...
|
||||||
On peut ouvrir un fichier spécifique
|
On peut ouvrir un fichier spécifique
|
||||||
EX/ https://gitlab.com/bonnebulle/plain-html-redo/-/blob/main/README.md
|
EX/ https://gitlab.com/bonnebulle/plain-html-redo/-/blob/main/README.md
|
||||||
@@ -123,7 +173,9 @@ EX/ https://gitlab.com/bonnebulle/plain-html-redo/-/blob/main/README.md
|
|||||||
--> Open in Web IDE...
|
--> Open in Web IDE...
|
||||||
|
|
||||||
|
|
||||||
DEPUIS CET IDE, on va pouvoir sauvegarder l'état d'avancement du projet en utilisant GIT
|
# DO Git commandes depuis l'IDE
|
||||||
|
|
||||||
|
DEPUIS notre IDE, on va pouvoir sauvegarder l'état d'avancement du projet en utilisant GIT
|
||||||
( qui se charge :
|
( qui se charge :
|
||||||
- de cloner "> clone https://gitlab.com/bonnebulle/plain-html-redo.git"
|
- de cloner "> clone https://gitlab.com/bonnebulle/plain-html-redo.git"
|
||||||
- de télécharger l'état actuel du projet présent sur le serveur git "> git pull"
|
- de télécharger l'état actuel du projet présent sur le serveur git "> git pull"
|
||||||
@@ -143,6 +195,15 @@ Ils permettent...
|
|||||||
... ainsi on comprend ce qui se passe "derière" quand on clic les boutons
|
... ainsi on comprend ce qui se passe "derière" quand on clic les boutons
|
||||||
... ( quelles commandes sont envoyées )
|
... ( quelles commandes sont envoyées )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# TUTOS + COMMANDES
|
||||||
|
|
||||||
- Git - Git dans Bash
|
- Git - Git dans Bash
|
||||||
↳ https://git-scm.com/book/fr/v2/Annexe-A:-Git-dans-d%e2%80%99autres-environnements-Git-dans-Bash
|
↳ https://git-scm.com/book/fr/v2/Annexe-A:-Git-dans-d%e2%80%99autres-environnements-Git-dans-Bash
|
||||||
|
|
||||||
@@ -155,19 +216,38 @@ Ils permettent...
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
CHECKOUT
|
# PULL (aspirer)
|
||||||
Changer de branche
|
|
||||||
TUTO https://git-scm.com/book/fr/v2/Les-branches-avec-Git-Gestion-des-branches
|
|
||||||
|
|
||||||
Etat des fichiers :
|
Récupère les fichiers tels que présents sur GitLab/Hub
|
||||||
|
( on récupère l'état de travail des fichiers présents sur le serveur )
|
||||||
|
> git pull
|
||||||
|
( va prévenir si des modifications difèrent en local )
|
||||||
|
|
||||||
|
# Etat des fichiers :
|
||||||
> git status
|
> git status
|
||||||
|
|
||||||
Ajouter un fichier (ou tous *)
|
Ajouter un fichier (ou tous *)
|
||||||
> git add ./README.md
|
> git add ./README.md
|
||||||
> git add *
|
> git add *
|
||||||
|
|
||||||
|
|
||||||
|
Remove du stash (état lattant avant commit + push)
|
||||||
|
> git rm ./README.md
|
||||||
|
|
||||||
|
annuler un ajout sur un fichier
|
||||||
|
> git checkout -- CONTRIBUTING.md
|
||||||
|
|
||||||
|
restaure
|
||||||
|
> git restore --staged CONTRIBUTING.md
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Commit
|
||||||
|
|
||||||
Git commit
|
Git commit
|
||||||
|
( sauvegarder l'état actuel des fichiers locaux )
|
||||||
> git commit
|
> git commit
|
||||||
|
|
||||||
... on écrit les modifications apportées dans le navigateur text
|
... on écrit les modifications apportées dans le navigateur text
|
||||||
... on peut installer nano https://command-not-found.com/nano
|
... on peut installer nano https://command-not-found.com/nano
|
||||||
... ou utiliser vim...
|
... ou utiliser vim...
|
||||||
@@ -175,6 +255,7 @@ Git commit
|
|||||||
.... on quitte+save en tappant -- ESCAPE + ":wq"
|
.... on quitte+save en tappant -- ESCAPE + ":wq"
|
||||||
.... on quitte no_save tappant -- ESCAPE + ":q!"
|
.... on quitte no_save tappant -- ESCAPE + ":q!"
|
||||||
/OU/ directement depuis la commmande
|
/OU/ directement depuis la commmande
|
||||||
|
|
||||||
> git commit -m 'initial commit of my project'
|
> git commit -m 'initial commit of my project'
|
||||||
|
|
||||||
Visualiser les modifications :
|
Visualiser les modifications :
|
||||||
@@ -185,20 +266,33 @@ Visualiser les modifications :
|
|||||||
voir l'historique
|
voir l'historique
|
||||||
> git log --pretty=format:"%h %s" --graph
|
> git log --pretty=format:"%h %s" --graph
|
||||||
|
|
||||||
annuler un ajout sur un fichier
|
# PUSH
|
||||||
> git checkout -- CONTRIBUTING.md
|
|
||||||
restaure
|
Envoi des modifications après un commit
|
||||||
> git restore --staged CONTRIBUTING.md
|
( qui valides les modifications locales apportées à tel ou tel fichier )
|
||||||
|
> git push
|
||||||
|
( id + TOKEN )
|
||||||
|
|
||||||
|
préciser la branch à qui envoyer le commit (et fichiers)
|
||||||
|
> git push --set-upstream origin main
|
||||||
|
( id + TOKEN )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BRANCHES
|
# BRANCHES
|
||||||
|
|
||||||
TUTO : https://git-scm.com/book/fr/v2/Les-branches-avec-Git-Les-branches-en-bref
|
TUTO : https://git-scm.com/book/fr/v2/Les-branches-avec-Git-Les-branches-en-bref
|
||||||
|
|
||||||
voir les branches ( locales + distantes )
|
voir les branches ( locales + distantes )
|
||||||
> git branch --all
|
> git branch --all
|
||||||
|
|
||||||
|
|
||||||
|
CHECKOUT
|
||||||
|
Changer de branche
|
||||||
|
|
||||||
|
TUTO https://git-scm.com/book/fr/v2/Les-branches-avec-Git-Gestion-des-branches
|
||||||
|
|
||||||
changer (basculer de branche)
|
changer (basculer de branche)
|
||||||
> git checkout -b forkit
|
> git checkout -b forkit
|
||||||
|
|
||||||
@@ -209,7 +303,7 @@ revenir/changer à la branche d'origine "main" (ou "forkit")
|
|||||||
envoyer les modifications à une branche spécifique
|
envoyer les modifications à une branche spécifique
|
||||||
> git push --set-upstream origin main
|
> git push --set-upstream origin main
|
||||||
|
|
||||||
merge
|
# merge
|
||||||
> git merge forkit
|
> git merge forkit
|
||||||
|
|
||||||
gestion de conflit de versions
|
gestion de conflit de versions
|
||||||
|
|||||||
Reference in New Issue
Block a user