Skip to content
Snippets Groups Projects
Verified Commit b278b484 authored by ck85nori's avatar ck85nori :railway_track:
Browse files

improves branch merge chapter

parent c2fa1c83
No related branches found
No related tags found
No related merge requests found
...@@ -771,11 +771,31 @@ ...@@ -771,11 +771,31 @@
# branch and merge # branch and merge
notes: notes:
- what was this **master** again? - this is a demo chapter, you'll all do this in collaboration
chapter (next one)
- what was this **master** again? we haven't explained yet
</section> </section>
<section id="branches" data-markdown> <section id="branch-visual" data-markdown>
## branches ## branches visualized
![playground](img/motivation-throwaway-playground.svg)
notes:
- we can take a lot away from this small example
- create a branch to have a separate history
- branch is a name attached to a commit
- the name advances when a new commit is made
- **master** is a naming convention for the default branch
- switch back and forth
- always imagine git history as a directed graph
- graph is drawn with new top and old bottom
- commit points to its parent
- git commands modify the graph
</section>
<section id="branch-commands" data-markdown>
## branch commands
```bash ```bash
# show your local branches # show your local branches
...@@ -792,36 +812,40 @@ ...@@ -792,36 +812,40 @@
``` ```
notes: notes:
- use wip/feature as branch name, see motivation playground ```
- use git lol frequently to showcase its importance # branch, branch --all
- make changes in playground git lol # show branches
- git push # branch wip/feature, lol
- make changes in master # checkout wip/feature, lol
- git lol # edit, commit, lol
- make changes in playground # push, lol
```
- always `lol` because visual representation helps understanding
</section> </section>
<section id="branch-names" data-markdown> <section id="branch-names" data-markdown>
## branch naming ## branch naming
### conventions ### conventions
- dashes in names ```bash
- slashes for categories # slashes for categories
```markdown
topic/ui/input-form
wip/test-different-fonts
hotfix/42 hotfix/42
release/1.6.0 release/1.6.0
# dashes in names
wip/font-changes
# nesting is allowed
topic/ui/input-form
``` ```
notes: notes:
- `git branch --list 'topic/*'` - `git branch --list 'topic/*'`
- decide with your team - decide with your team
- write CONTRIBUTING.md - write `CONTRIBUTING.md`
</section> </section>
<section id="merging" data-markdown> <section id="branch-merging" data-markdown>
## resolving branches ## resolving branches
```bash ```bash
...@@ -834,7 +858,11 @@ ...@@ -834,7 +858,11 @@
``` ```
notes: notes:
- use git lol to show final layout ```
# checkout master, lol
# merge wip/feature, lol
# branch -d wip/feature, lol
```
</section> </section>
</section> </section>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment