correction de git branch -b en rajoutant une partie git checkout
This commit is contained in:
parent
9596034fb7
commit
d5e02de950
19
HowtoGit.md
19
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 <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 :
|
||||
|
||||
|
|
Loading…
Reference in New Issue