Coder Social home page Coder Social logo

ks-bisect's Introduction

Using GIT Bisect

WHICH COMMIT WAS THIS ADDED?

You should be able to find the commit hash tag in less than 5 bisect moves.

Your other option might be to checkout every commit yourself until you finally find it. This may not be so bad for this example exercise, but would be horrible if you had to compule and execute tests in a simulator.

Introduction

I've created a GIT cheatsheet to use, so I'll always have it, because my memory isn't what it used to be.

GIT Bisect

Works great for quickly finding a bug that was introduced, but at an unknown time.

{{FINDME}}

Step 1 - Read the Bisect Debugging Section Step 2 - Ensure no changes are pending in your active branch Step 3 - Start the bisect process Step 4 - Mark the top commit as bad Step 5 - Mark a commit as good git bisect bad Step 5a - git log --oneline Step 5b - git checkout 415dfc6 Step 5c - if checkouted out branch does not have bug, mark as good git bisect good Step 6 - Repeat processes

EXECUTE:

  • git log --oneline
  • git bisect start
  • git bisect good bf8b150
  • git bisect bad

Off Topic Tips

  • Using await does not block the main thread.
  • Does adding async to a normal function turn it into a promise?

GIST Info

git bisect start  # start session
git bisect good 0x12abcd # detached HEAD
git bisect bad    # identify current commit as bad

# run tests to determine if bug exists
git bisect good
git log --oneline

# identifed commit with the bug
git bisect bad
git bisect reset # reset HEAD to master when done OR if you have un-stashed changes

git diff 8552d2e..415dfc6
git difftool 8552d2e..415dfc6 # requires initial setup

ks-bisect's People

Watchers

Michael N avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.