Planche provenant de CommitStrip
Planche provenant de CommitStrip
Windows, Mac, Linux
Debian / Ubuntu / Mint
sudo apt-get update
sudo apt-get install gitWindows : http://cmder.net/
Dépôt (repository) : votre projet
Commit : une sauvegarde de l'état du projet à un instant t
Branche : permet de développer des fonctionnalités (en parallèle) sans affecter le code en production (branche master)
Head : l'état actuel (= référence vers un commit) de votre dossier local, souvent le dernier commit
Origin : nom par défaut (convention) du serveur principal avec lequel votre dossier local peut être synchronisé
Première fois avec git
git config --global user.name "Jon Snow"
git config --global user.email jon.snow@example.comEveryday Git in twenty commands or so
git help everydayCréer un nouveau dépôt
Ajouter des fichiers à la validation
Valider les fichiers
Voir le status actuel du dépôt
git initgit statusgit add monFichiergit add .git commit -m "Decrire ici la modification"Voir les modifications
git diffStaging Area
Dossier De Travail
Dépôt (dossier .git)
"Zone de transit"
Checkout
Add
Commit
Cloner un dépôt
Envoyer les modifications au serveur
Synchroniser avec la version du serveur (+fusionner)
git clone git@gitlab.ensta.fr:mon_repo.gitgit pull origin mastergit pullgit log --onelinegit logHistorique des modifications
git push origin mastergit pushDépôt Local (dossier .git)
Push
Serveur
"origin"
Serveur
"autre_serveur"
Pull
Créer une clé ssh (si besoin)
Ajouter un serveur
Copier la clé publique (puis l'enregistrer sur le serveur)
ssh-keygen -t rsa -C "email@ensta-paristech.fr"cat ~/.ssh/id_rsa.pubgit push -u origin masterSynchroniser avec le serveur une branche locale
git remote -vLister les serveurs
git remote add origin URL_DU_REPO_GITgit remote set-url origin NOUVELLE_URL_DU_REPO_GITModifier l'url d'un serveur
GIT - the stupid content tracker
"git" can mean anything, depending on your mood.
- random three-letter combination that is pronounceable, and not
actually used by any common UNIX command. The fact that it is a
mispronounciation of "get" may or may not be relevant.
- stupid. contemptible and despicable. simple. Take your pick from the
dictionary of slang.
- "global information tracker": you're in a good mood, and it actually
works for you. Angels sing, and a light suddenly fills the room.
- "goddamn idiotic truckload of sh*t": when it breaks
This is a stupid (but extremely fast) directory content manager. It
doesn't do a whole lot, but what it _does_ do is track directory
contents efficiently. Présentation de GIT par son créateur : Linus Torvald