|
1 | 1 | ### What broke my code? |
2 | 2 |
|
3 | | -Something's been broken, but I don't know what commit broke it. |
| 3 | +> Something's been broken, but I don't know what commit broke it. |
4 | 4 |
|
5 | | -There's a test in this directory, checking if any file is empty or not. |
| 5 | +There's a test in this directory, checking if any file is empty or not. This only _finds_ the commit introducing the break, it doesn't fix it at all. |
6 | 6 |
|
7 | | -1. `ls` |
8 | | -1. `. test.sh` |
9 | | - |
10 | | -To get set up, run the scripts: |
11 | | - |
12 | | -2. `. setup.sh` |
13 | | -3. `. test.sh` to find something's broken |
14 | | - |
15 | | -Before you can use bisect, you need to be in the root directory of the repository. |
16 | | - |
17 | | -1. `cd ..` |
18 | | -1. `. 04-what-broke-this/test.sh` |
19 | | -1. `git bisect start` |
20 | | -1. `git bisect bad HEAD` |
21 | | -1. `git bisect good before-activity4` |
22 | | -1. `. 04-what-broke-this/test.sh` |
23 | | -1. `git bisect good` or `git bisect good`, depending on the results of the test |
24 | | -1. Continue until it finds the commit |
25 | | -1. `git bisect reset` |
26 | | -1. `. 04-what-broke-this/reset.sh` |
| 7 | +1. Change directories into the activity file: `cd 04-what-broke-this` |
| 8 | +2. See the test with `ls`, and try it with `. test.sh` |
| 9 | +3. To get set up, run the scripts `. setup.sh` |
| 10 | +4. Use the test `. test.sh` to find if something's broken |
| 11 | +5. Before you can use bisect, you need to be in the root directory of the repository: `cd ..` |
| 12 | +6. Try the test again: `. 04-what-broke-this/test.sh` |
| 13 | +7. Begin the bisect: `git bisect start` |
| 14 | +8. Tell Git where the "broken" commit is: `git bisect bad HEAD` |
| 15 | +9. Tell Git where the last known "good" commit was: `git bisect good before-activity4` |
| 16 | +10. After Git moves your `HEAD` pointer to a different commit, try your test again: `04-what-broke-this/test.sh` |
| 17 | +11. Depending on the results of the test, type `git bisect good` or `git bisect good` |
| 18 | +12. Continue until Git finds the commit |
| 19 | +13. Exit the bisect: `git bisect reset` |
| 20 | +14. Reset the files: `. 04-what-broke-this/reset.sh` |
0 commit comments