]> rtime.felk.cvut.cz Git - hubacji1/oneflow.git/commitdiff
Extend creating branches section
authorJiri Hubacek <hubacji1@fel.cvut.cz>
Fri, 12 Oct 2018 11:04:19 +0000 (13:04 +0200)
committerJiri Hubacek <hubacji1@fel.cvut.cz>
Fri, 12 Oct 2018 11:10:24 +0000 (13:10 +0200)
branching.md

index b497fb4e4f2a05844bdb7d2e23bb2222205a984f..0e388b09401dd38531cff81bf758108ff1f11c0b 100644 (file)
@@ -11,9 +11,14 @@ history. The main history branch is named `master` by default.
 `git branch` command show all the local branches and the active branch you are
 currently on. Show remote branches by `git branch --all` command.
 
-# Split - create alternative branch
-When decided to create new branch `git checkout -b NAME` can be used. Switching
-between branches is done by `git checkout NAME` command.
+# Create and switch branches
+When decided to create new branch `git branch NAME` can be used. The branch
+will be created from the current state called *HEAD*. Switching between
+branches is done by `git checkout NAME` command. Checkout to specific commit is
+also possible by `git checkout COMMIT_ID`.
+
+If branch creation from specified commit is prefered, use `git branch NAME
+COMMIT_ID`.
 
 # Merge - join multiple branches
 To the current branch, any other branch may be merged. The result is history
@@ -31,10 +36,11 @@ COMMIT` takes current branch and put it on top of the `COMMIT`.
 - `git branch`
 - `git branch --all`
 
-## Split
-- `git checkout -b NAME`
-- `git checkout -b NAME COMMIT`
+## Create
+- `git branch NAME`
+- `git branch NAME COMMIT_ID`
 - `git checkout NAME`
+- `git checkout COMMIT_ID`
 
 ## Merge
 - `git merge --no-ff NAME`