Git

Un article de Haypo.

(Différences entre les versions)
Version du 4 janvier 2010 à 14:44 (modifier)
Haypo (Discuter | Contributions)
(Numéro de commit)
← Différence précédente
Version actuelle (15 juillet 2014 à 22:41) (modifier) (défaire)
Haypo (Discuter | Contributions)

 
(7 révisions intermédiaires masquées)
Ligne 3 : Ligne 3 :
[http://git-scm.com/ git] [http://git-scm.com/ git]
 +
 +== Branches ==
 +
 +Récupérer toutes les branches distantes :
 +
 + git branch -r
 + # git remote update
 + for remote in `git branch -r`; do git branch --track $remote; done
 + git pull --all
 +
 +http://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches
== Numéro de commit == == Numéro de commit ==
Ligne 9 : Ligne 20 :
* HEAD * HEAD
-* n^ = n-1+* n^ = n-1 (parent)
-* n^p = n-2+* n^p = n-p (n-ième parent)
-* n~p n +* n~p = n^^^..^p (parent de la p-ième génération)
-* n@{p}+* n@{p} (p-ième parent ?)
-* {yesterday}, {1 month 2 weeks 3 days 1 hour 1 second ago}, {1979-02-26 18:30:00}+* @{yesterday}, @{1 month 2 weeks 3 days 1 hour 1 second ago}, @{1979-02-26 18:30:00}
* tag * tag
Ligne 20 : Ligne 31 :
* « n^! » [n; n] = n..n (n tout seul) * « n^! » [n; n] = n..n (n tout seul)
* « n.. » [n; HEAD] = n+1, n+2, ... * « n.. » [n; HEAD] = n+1, n+2, ...
 +
 +== svn ==
 +
 +* svn cat -r REV chemin <=> git show REV:chemin
 +* svn export . ~/export <=> git checkout-index -a --prefix=/home/haypo/export/
 +** N'utilisez pas ~, git checkout-index ne sait pas le remplacer
 +** Notez bien le / à la fin
== Documentation == == Documentation ==
* [http://book.git-scm.com/ Git Community Book] * [http://book.git-scm.com/ Git Community Book]
 +
 +== Voir aussi ==
 +
 +* [http://whygitisbetterthanx.com/ Why Git is Better than X]
 +* [http://www.haypocalc.com/blog/index.php/2009/09/02/203-reparer-depot-git-echec-git-svn-dcommit Réparer un dépôt git après l'échec de git svn dcommit]
 +* [http://www.haypocalc.com/blog/index.php/2009/09/12/208-git-supprimer-commit-reediter-changelog git : supprimer un commit, rééditer le dernier changelog] (git rebase -i, git commit --amend)
 +* [http://www.haypocalc.com/blog/index.php/2008/11/05/172-git-svn Create a git repository of a svn source tree using git-svn]

Version actuelle

Retour à la page précédente Retour aux articles de programmation

git

Sommaire

[modifier] Branches

Récupérer toutes les branches distantes :

git branch -r
# git remote update
for remote in `git branch -r`; do git branch --track $remote; done
git pull --all

http://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches

[modifier] Numéro de commit

git help rev-parse
  • HEAD
  • n^ = n-1 (parent)
  • n^p = n-p (n-ième parent)
  • n~p = n^^^..^p (parent de la p-ième génération)
  • n@{p} (p-ième parent ?)
  • @{yesterday}, @{1 month 2 weeks 3 days 1 hour 1 second ago}, @{1979-02-26 18:30:00}
  • tag

Intervalle :

  • « n..p » [n; p] = n, n+1, ..., p-1, p
  • « n^! » [n; n] = n..n (n tout seul)
  • « n.. » [n; HEAD] = n+1, n+2, ...

[modifier] svn

  • svn cat -r REV chemin <=> git show REV:chemin
  • svn export . ~/export <=> git checkout-index -a --prefix=/home/haypo/export/
    • N'utilisez pas ~, git checkout-index ne sait pas le remplacer
    • Notez bien le / à la fin

[modifier] Documentation

[modifier] Voir aussi