Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| public:git [2024/10/23 13:45] – [GIT RESET] vincent1890 | public:git [2024/10/24 11:30] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== | + | ====== |
| - | ===== Install : ===== | + | ===== Installation |
| Installer Oh-My-Bash à l’aide de curl | Installer Oh-My-Bash à l’aide de curl | ||
| - | bash -c " | + | |
| Après l’installation : | Après l’installation : | ||
| - | source ~/.bashrc | + | |
| Modifier thème de Bash dans ~/.bashrc \\ | Modifier thème de Bash dans ~/.bashrc \\ | ||
| Ligne 20: | Ligne 20: | ||
| source ~/.bashrc | source ~/.bashrc | ||
| + | \\ | ||
| + | \\ | ||
| + | ===== Utilisation ===== | ||
| - | ===== Usage - cours ===== | + | ==== Configurer |
| - | + | ||
| - | ==== Configurer | + | |
| - | === Configurer un projet | + | === Configurer un projet |
| # configuration locale d'un projet | # configuration locale d'un projet | ||
| Ligne 40: | Ligne 41: | ||
| # Pour facilité la vision des logs | # Pour facilité la vision des logs | ||
| git config --global pager.log false | git config --global pager.log false | ||
| - | ==== Commandes | + | ==== Commandes |
| === Installer git === | === Installer git === | ||
| dnf install git # redhat/ | dnf install git # redhat/ | ||
| Ligne 92: | Ligne 93: | ||
| ==== Git BRANCH ==== | ==== Git BRANCH ==== | ||
| - | Créér une branche | + | === Créér une branche |
| git branch develop | git branch develop | ||
| - | Supprimer une branche | + | |
| + | === Supprimer une branche | ||
| git branch -d nom-de-branche | git branch -d nom-de-branche | ||
| - | Changer de branche | + | |
| + | === Changer de branche | ||
| git checkout develop | git checkout develop | ||
| - | Créér et changer de branche | + | |
| + | === Créér et changer de branche | ||
| git checkout -b develop | git checkout -b develop | ||
| - | Voir les branches | + | |
| + | === Voir les branches | ||
| git branch | git branch | ||
| - | Fusionner deux branches | + | |
| + | === Fusionner deux branches | ||
| # se positionner sur la branche où il va y' | # se positionner sur la branche où il va y' | ||
| git checkout master | git checkout master | ||
| + | |||
| # faire la fusion de la branch vers celle ou on est positionné | # faire la fusion de la branch vers celle ou on est positionné | ||
| git merge develop | git merge develop | ||
| Ligne 123: | Ligne 130: | ||
| ==== Git TAG ==== | ==== Git TAG ==== | ||
| Donner des numéros de versions à ses commits | Donner des numéros de versions à ses commits | ||
| - | Créér un tag | + | === Créér un tag === |
| git tag v1.0 | git tag v1.0 | ||
| - | voir un tag | + | |
| + | === Voir un tag === | ||
| git tag | git tag | ||
| git show v0.1 | git show v0.1 | ||
| - | Créér | + | |
| - | # regarder | + | === Procedure pour créér |
| + | # Regarder | ||
| git log --oneline | git log --oneline | ||
| - | # tagger un hash | + | |
| + | # Tagger le hash du commit souhaité | ||
| git tag v0.1 70ae760 | git tag v0.1 70ae760 | ||
| - | # voir un tag | + | |
| + | # Vérifier le TAG | ||
| git show v0.1 | git show v0.1 | ||
| Ligne 157: | Ligne 168: | ||
| - | ==== Push / Pull ==== | + | ==== Git PUSH / PULL ==== |
| La toute premiere fois pour la branche ou branche qui n' | La toute premiere fois pour la branche ou branche qui n' | ||
| git push --set-upstream origin nom-de-branche | git push --set-upstream origin nom-de-branche | ||
| Ligne 170: | Ligne 182: | ||
| - | ===== Git ROLLBACK | + | ==== Git ROLLBACK ==== |
| === Rollback d'une modification non encore commitée === | === Rollback d'une modification non encore commitée === | ||
| Ligne 185: | Ligne 197: | ||
| git reset --hard HEAD~1 | git reset --hard HEAD~1 | ||
| - | ==== GIT REVERT | + | ==== Git REVERT |
| === commande git revert (garde l' | === commande git revert (garde l' | ||
| git revert [hash commit1] [hash commit 2] ... | git revert [hash commit1] [hash commit 2] ... | ||
| + | | ||
| + | \\ | ||
| + | \\ | ||
| ===== TP ===== | ===== TP ===== | ||
| Command line instructions | Command line instructions | ||