« Utilisation Git » : différence entre les versions
Aucun résumé des modifications |
|||
| Ligne 56 : | Ligne 56 : | ||
http://www.opensourcery.co.za/2008/05/03/converting-a-mercurial-repo-to-git/ | http://www.opensourcery.co.za/2008/05/03/converting-a-mercurial-repo-to-git/ | ||
envoyer une branch sur un repo distant : | |||
git push nombranche | |||
recevoir branche repo distant | |||
git pull | |||
git checkout -b nombranche origin/nombranche | |||
</poem> | </poem> | ||
Version du 5 septembre 2011 à 19:41
Installation
<poem> Config générale git config --global user.name "Your Name" git config --global user.email youremail@example.com
Alias pour se simplifier la vie git config --global alias.co checkout
Associer son éditeur préféré git config --global core.editor "gedit -w" (pas certain du fonctionnement de la commande) </poem>
Utilisation
<poem>Création du dépot : Dans le dossier racine du projet git init
ajout de tous les fichiers du dossier : git add .
Commit git commit -m "commentaire du commit"
Historique git log
Revenir au dernier commit et annuler les derniers changements de la branche en cours git checkout -f
Derniers changements depuis le dernier commis git status
Créer une branch git checkout -b nomdelabranche
Etat des branches git branch
Renommer ou déplacer un fichier avec git git mv source cible
Fusionner deux branches : se placer dans la branche souhaitée : git checkout master
initier le merge: git merge nomdelabrancheamerger
Envoyer les modifications sur le serveur: git push
Récuperer les changements sur le repo d'origine git fetch ou git fetch nomrepoorigine
http://www.opensourcery.co.za/2008/05/03/converting-a-mercurial-repo-to-git/
envoyer une branch sur un repo distant : git push nombranche
recevoir branche repo distant git pull git checkout -b nombranche origin/nombranche </poem>
