diff --git a/HowtoGit.md b/HowtoGit.md index abd016f9..8d496dd1 100644 --- a/HowtoGit.md +++ b/HowtoGit.md @@ -347,17 +347,28 @@ $ git fetch $ git reset origin ~~~ -### git branch +### git checkout -XXX: c'est git checkout -b, git branch -b n'existe pas. Du coup, -revoir cette section. +Pour avoir le dépôt tel qu'il était à un commit : + +~~~{.bash} +$ git checkout +~~~ + +Pour se remettre sur la version courrante : + +~~~{.bash} +$ git checkout master +~~~ Pour créer une branche et switcher directement dans cette nouvelle branche, on utilise l'option `-b` : ~~~{.bash} -$ git branch -b myfeature master +$ git checkout -b myfeature ~~~ +### git branch + Une branche est en fait la création une déviation, un commit qui a deux *enfants*. On peut ainsi créer une branche à partir de n'importe quel commit :