git

Afficher l'état de la branche en cours : 

git status

Ajouter des modifications à un commit : 

git add <chemin vers mon fichier>

Commit : 

git commit -m "Mon message de commit"

Envoie du commit : 

git push

Récupération des derniers commits distants : 

git pull

Supprimer le dernier commit : 

git reset --hard HEAD~1

Options : 

Changer de branche : 

git checkout <nom de ma branche>

Astuces : 

Tu t'es trompé de branches et tu veux pas perdre ton code ? 

Sauvegarder ton code dans un tampon : 

Avance de stash, il faut avoir add ton code en faisant un git add /path/to/file

git stash

Fait ton changement de branche :

git checkout ....

Applique ton code en mémoire tampon : 

git statch pop

 


Revision #3
Created 7 December 2022 16:48:22 by Nehemie
Updated 20 January 2023 10:26:04 by Nehemie