Site officiel : http://git-scm.com/
yum install git-core
apt-get install git-core
sudo port install git-core
git config --global color.diff auto git config --global color.status auto git config --global color.branch auto
Créer un dossier pour héberger votre projet git s'il n'existe pas et s'y positionner.
git init
git clone https://git.renater.fr/anonscm/git/nom_projet/nom_projet.git
git clone ssh://<nom utilisateur unix>@git.renater.fr:2222/scmrepos/git/nom_projet/nom_projet.git
Cela va créer un dossier et y télécharger tout le code source du projet ainsi que l'historique de chacune des modifications.
git status
git diff
git add .
git add nom_fichier
git commit -m "commentaire associé au commit" git@git.cru.fr:nom_projet.git nom_branche (par défaut master représentant la branche principale)
git log git log - p (pour avoir plus détails)
git commit --amend
git reset --hard HEAD^
git checkout nomfichier
Par défaut, une seule branche présente ; la branche principale “master”.
git branch
La branche sur laquelle on est positionné est indiquée par une étoile devant.
git branch nom_nouvelle_branche
git checkout nom_branche
git checkout master git merge nom_branche_a_fusionner
git branch -D nom_branche_a_supprimer
git tag nom_tag id_commit
git tag -d nom_tag_a_supprimer
git rm monfichier.ext