benthayer / benthayer/git-gud

Level: Rewriting History 5 - "Splitting Hairs"

Open
#259 0 comments 0 reactions 1 assignee Claimed by @benthayer View on GitHub
level - educational
Dominant language
Python
Stars
558
Forks
53
PR merge metrics
No merged PRs in 30d

Description

```
5) Splitting Hairs - Split the changes from the first branch to be on two branches
```

Work1, Work2, Work3 all go together
Start Fixing Bug is part of a separate set of changes
They each belong on their own branch

The level is complete when the changes from Work1, Work2, Work3 are on their own branch and the changes from Start Fixing Bug are on their own branch too. The branches can be named whatever. "master" should stay the same

`git gud status`
```
master:
Commits: Initial Commit
Files: file.txt

branch1:
Commits: Work1, Work2, Work3
Files: file1.txt, file2.txt, file3.txt

Other branch:
Commits: Start Fixing Bug
```

Work2 has one change that depends on "Start Fixing Bug" that results in a conflict
```
Start:
Initial (master) ---- Work1 ---- Start Fixing Bug ---- Work2 ---- Work3 (branch1)

End:
Initial (master) ---- Work1 ---- Work2 ---- Work3 (branch1)
\
Start Fixing Bug (bugFix)

Contents can be somthing like this:
Initial:
Hello mom
Hello dad

Work1:
Hello earth

Start Fixing Bug: (Changes text to say goodbye rather than hello)
Goodbye earth

Work2:
Goodbye world
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.