Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.
For the best experience please use the latest Chrome, Safari or Firefox browser.
sudo apt-get install git
pdupont
pour Pierre Dupont)git config --global user.name "Votre nom"
git config --global user.email "Votre email"
git config --global color.ui auto
.git
.
git init nom_du_repository
git clone url_du_repository
ipi-git-local
, puis créer un repository sur github nommé ipi-git-github
.
ipi-git-github
ainsi que celui situé à l'adresse https://github.com/votreuser/ipi-git-github.git
villoud.txt
git add villoud.txt
git commit -m "Création du fichier villoud.txt"
git push
villoud.txt
git status
git diff villoud.txt
ipi-git-local
et ipi-git-github
et constater à chaque étape le contenu des repository locaux et distants (le cas échéant).
ipi-git-200-ex
, nous allons rencontrer un blocage nous empêchant d'envoyer nos changements sur le repository.
dupond.txt
git add dupond.txt
git commit -m "Création du fichier dupond.txt"
git push
git pull
git push
listeNoms.txt
pour ajouter mon prénom à la suite de mon nomgit add listeNoms.txt
git commit -m "Modification du fichier listeNoms.txt"
git push
git pull
git push
noms.txt
et que vous refaites les mêmes manipulations ?
DURAND
<<<<<<< HEAD
VILLOUD
=======
FAURE
>>>>>>> 97ef45b...
Pour résoudre le conflit :
git add noms.txt
git commit
git push
main
. Ce mécanisme de branches permet également de gérer le développement parallèle de plusieurs fonctionnalités, ou la maintenance des différentes versions d'un logiciel. Pour approfondir voir les différents workflows.
git branch
git branch nom-branche
git checkout nom-branche
git merge nom-branche
git branch -d nom-branche
git push --set-upstream origin mabranche
fix-votrenom
votrenom.txt
et commiter la modificationmain
.fix-votrenom
fix-votrenom
sur main
fix-votrenom
main
git branch fix-villoud
git branch
git checkout fix-villoud
git commit -am "Suppression du fichier villoud.txt"
git checkout main
git pull
git checkout fix-villoud
git merge main
git checkout main
git merge fix-villoud
git branch -d fix-villoud
git push
origin
la branche fix-votrenom
, elle reste donc uniquement sur notre repository local. Il est possible de l'envoyer sur le repository distant avec git push --set-upstream origin fix-votrenom
git checkout [hash-commit|nom-branche|nom-tag]
git stash => git stash pop
git reset [hash-commit]
git reset --hard [hash-commit]
git rm fichier / git mv fichier fichier2
git rm --cached fichier
git revert mon-commit
git reset --hard
git stash
git checkout fix-villoud
git commit -am "mes modifications"
git reset HEAD^
git checkout main
git stash pop
...git revert [hash-commit]
...git checkout [hash-commit]
git checkout main
git log
git log --graph
git tag -a nom-tag / git tag -l
git cherry-pick mon-commit
fork
ipi-git-200-fork
votreuser/ipi-git-200-fork
en localpjvilloud/ipi-git-200-fork
main
de repository de référence qui contient une nouvelle modification, dans ma branche main
main
de pjvilloud/ipi-git-200-fork
git clone https://github.com/votreuser/ipi-git-200-fork
git commit -am "mes modifications"
git push
git remote add upstream https:.../pjvilloud/ipi-git-200-fork
git fetch upstream
git merge upstream/main
git push
votreuser/ipi-git-200-fork:main
vers pjvilloud/ipi-git-200-fork:main
. Validation .gitignore