22
0
Fork 0

correction de git branch -b en rajoutant une partie git checkout

This commit is contained in:
Daniel Jakots 2016-12-19 16:59:11 -05:00
parent 9596034fb7
commit d5e02de950
1 changed files with 15 additions and 4 deletions

View File

@ -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 <SHA1 du commit>
~~~
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 :