User Tools

Site Tools


git:git_bisect

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
git:git_bisect [2016/11/22 09:55] petergit:git_bisect [2019/11/29 14:59] (current) – removed peter
Line 1: Line 1:
-====== GIT - git bisect ====== 
- 
-This command is great when you want to find out which commit introduced a breaking change.  bisect performs a binary search to help you pinpoint which commit is bad.  All you have to do is tell it which commit was bad, a commit that's good, and it'll automatically checkout the commits in between and have you test them.  Once you're finished git bisect reset. 
- 
-<code git> 
-git init 
-Initialized empty Git repository in /home/john/Projects/git-bisect-test/.git/ 
- 
-echo "bacon" > bacon.txt 
-git add bacon.txt 
-git commit -am "add bacon file" 
-[master (root-commit) 0113afa] add bacon file 
- 1 file changed, 1 insertion(+) 
- create mode 100644 bacon.txt 
- 
-echo "cheese" > cheese.txt 
-git add cheese.txt 
-git commit -am "add cheese" 
-[master (root-commit) db5019e] add cheese 
- 1 file changed, 1 insertion(+) 
- create mode 100644 cheese.txt 
- 
-ls 
-bacon.txt cheese.txt 
- 
-echo "introduce bug" >> bacon.txt 
-git commit -am "introduce bug" 
-[master (root-commit) c7a5fa2] introduce bug 
- 1 file changed, 1 insertion(+) 
- 
-git log --oneline  
-c7a5fa2 introduce bug 
-db5019e add cheese 
-0113afa add bacon file 
- 
-git bisect start 
-git bisect bad 
-git bisect good 0113 
-Bisecting: 0 revisions left to test after this (roughly 0 steps) 
-[db5019e38614ef383cb89095891cb968d3662168] add cheese 
- 
-git bisect good 
-c7a5fa2aea65d90d40a97807005b62c29fa7b2f4 is the first bad commit 
-commit c7a5fa2aea65d90d40a97807005b62c29fa7b2f4 
-Author John Smith <john.smith@gmail.com> 
-Date:  Wed Jul 22 11:08:54 2015 -0700 
- 
-    introduce bug 
- 
-:100644 100644 63953b20236748b0e581a68b6f5b26458c006d9d 988aa7edb7f8848c3853f3561148a8832e8f2907 M           bacon.txt 
- 
-git bisect reset 
-Previous HEAD position was db5019e... add cheese 
-Switched to branch 'master' 
-</code> 
  
git/git_bisect.1479808529.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki