Académique Documents
Professionnel Documents
Culture Documents
1.git config –global user.name <nom> :Modifie le nom d’utilisateur dans votre
config git
2.git config –global user.email <mail>:Modifie l’adresse email dans votre
configuration git
3.git init <le_nom_de_votre_repo_git> :Initialise un nouveau repo git
4.git init --bare <nom_de_depot> :Initialise un repo sans working tree
5.git clone <url_du_depot_git> :Clone un repo git
6.git add <nom_du_ou_des_fichier(s)> :Ajoute les fichiers spécifiés à l’index
7.git add * :Ajoute tous les fichiers à l’index
8.git add --patch * :Ouvre le mode interactif de git add
9.git commit :Permet de commit des modifications
10.git commit -m <message_de_commit> :Permet de commit en donnant un
message de commit
11.git commit –a :Add & commit tous les fichiers modifiés ou supprimés
12.git diff :Montre les modifications dans l’index non commitées
13.git diff <branche_1> <branche_2> :Montre les différences entre deux
branches
14.git reset <fichier> :L’inverse de git add
15.git reset <hash_du_commit> :Retourne au commit choisi
16.git reset –hard <hash_du_commit> :Pareil mais supprime tous les
changements
17.git status:Affiche les statuts du working tree
18.git rm <fichier(s)> :Supprime les fichiers du working tree et de l’index
19.git log :Affiche l’historique des commits
20.git log –follow <nom_du_fichier> :Affiche l’historique des changements du
fichier
21.git show <hash_du_commit> :Affiche les détails d’un commit
22.git tag <hash_du_commit> :Donne un tag au commit
23.git branch :Liste toutes les branches locales du repo actuel
24.git branch <branche> :Crée une nouvelle branche
25.git branch -d <branche> :Supprime une certaine branche
26.git checkout <branche> :Permet de changer de branche
27.git checkout -b <branche> : Crée une nouvelle branche et passe dessus
28.git merge <branche> :Merge une branche à la branche actuelle
29.git remote add <nom> <lien_git> : Ajoute un serveur git en lui donnant un
nom remote
30.git push : Push le commit sur git
31.git push <remote> <branche> :Push le commit en spécifiant un repo et une
branche
32.git push –all <remote> :Push tous les commits de toutes branches sur
remote
33.git pull <branche> :Pull les derniers commits d’une branche