Cheatography
https://cheatography.com
Commandes pour Git et GitHub
Pourquoi utiliser Git ?Git est utilisé pour gérer les versions d'un programme et la collaboration entre les développeurs. |
Creer et Utiliser une clef SSH1) Créer la clef ssh :
ssh-keygen -t rsa -C "mail@domain.com"
(email du compte)
2) Copier la clef :
pbcopy <~/.ssh/id_rsa.pub
4) Accès au compte GitHub :
ssh -T git@Github.com
(après ça, tapez Y puis Entrer pour ajouter la clef au hôte)
Vous pouvez maintenant faire un git clone :
git clone git@Github.com pseudo/ HYPERLINK <repository_link> |
| | Premiere utilisationConfigurer Git
git config --global user.name "Prenom Nom"
git config --global user.email "mail@monsite.fr"
Configuration et acces à GitHub
1) Inscription sur :
http://github.com/signup/free
2) Configurer son repository
Utilisez cette commande dans le dossier du projet :
git init |
Commandes Gitgit init
| Initialisation d'un répertoire | git status
| Affiche le statut | git add <file>
| Ajoute un fichier | git add *
| Ajoute les nouveaux fichiers | git delete <file>
| Supprime un fichier | git commit -m "the message"
| Créer un commit avec un message | git log
| Affiche les commits antérieurs à l'actif | git show <commit_hash>
| Affiche les infos d'un commit | git branch <branch>
| Crée une branche | git branch -v
| Affiche les branches courantes | git checkout <parameters>
| Switch sur une branche ou un commit | git checkout -b <branch_name>
| Créer une nouvelle branche et switch dessus | git merge <branch>
| Fusionne la branche citée et le branche active | git remote add <remote_name> <repository_link>
| git push -u <remote_name> <branch_name>
| git pull <remote_name> <branch_name>
| git clone <repository_link>
| Clone un projet sur sa machine | git help <command>
| Détails d'une commande | git help
| Liste des commandes | git diff
| Affiche les différences entre différents commits ou branches | git stash
| Créer une sauvegarde locale mise de côté (hors du projet) | git stash list
| Liste toutes les sauvegardes locales existantes |
|
Help Us Go Positive!
We offset our carbon usage with Ecologi. Click the link below to help us!
Created By
alexandre.achain.chez.com
Metadata
Comments
Thanks for your work, it helped me a lot !
You're welcome ! ;)
Add a Comment
Related Cheat Sheets
More Cheat Sheets by Weizu