- http://ndpsoftware.com/git-cheatsheet.html
- https://git-scm.com/
- https://www.atlassian.com/git/tutorials
Commande | Description | Exemple |
---|---|---|
Add | ||
git add <nom_du_fichier> | ajouter un fichier | git add README.md |
Branch | ||
git branch | donne le nom de la branch | |
git branch <nom_de_la_branche> | Créé une branche avec le nom donné | git branch test |
git branch -a | Liste les branches local et distantes | |
git branch –all | Liste les branches local et distantes | |
git branch -r | Liste les branches distantes | |
git branch -d <nom_de_la_branche> | supprime la branche désigné par son nom | |
Checkout | ||
git checkout <nom_de_la_branche> | Permet de changer de branche, vous passerez sur la branche master | git checkout master |
git checkout -b <nouvelle-branche> | Créé une nouvelle branche et vous place dessus | git checkout -b new_branch |
git checkout –track <nom_de_la_branche> | ||
Clone | ||
git clone <dépot_distant.git> | Télécharge le dépot_distant.git et nous positionne sur la Head de sa branche Master | git clone https://my_id@bitbucket.org/bibleta/my_project.git |
Commit | ||
git commit -m « <description des modifications> » | Committer les modifications de l’espace de travail vers le dépôt local | |
Pull | ||
git pull | ||
git pull dépôt_distant référence | Récupère les modifications associées à la référence du DÉPÔT_DISTANT et les fusionne dans la branche courante. | |
Status | ||
git status | Liste les modifications en cours | |
Switch | ||
git switch <branche> | Échange les branches en mettant à jour l’ESPACE_DE_TRAVAIL et l’INDEX pour charger la BRANCHE spécifiée en positionnant la TÊTE dessus. |
Mémo-Git